-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (42 loc) · 1.3 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Publish Package
on:
workflow_dispatch: {}
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install deps
run: yarn install
- name: Typecheck
run: yarn typecheck
- name: Build
run: yarn build
- name: Determine Release version
id: get_version
run: |
release_version=$(cat package.json | jq -r '.version')
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- name: Pack npm package
run: npm pack
id: pack_npm
env:
PACKAGE_FILE: ${{ steps.get_version.outputs.RELEASE_VERSION }}.tgz
- name: Perform Github Release
uses: softprops/action-gh-release@v1
env:
FILE_PATTERN: "!(.github)"
with:
name: ${{ env.RELEASE_VERSION }}
tag_name: ${{ env.RELEASE_VERSION }}
generate_release_notes: true
files: ${{ env.PACKAGE_FILE }}
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{secrets.SIMON_NPM_AUTH_TOKEN}}
run: |
echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > ~/.npmrc
npm publish ${{ env.PACKAGE_FILE }}