-
Notifications
You must be signed in to change notification settings - Fork 71
42 lines (39 loc) · 1.23 KB
/
publish-package.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
name: Publish npm Package
on:
pull_request:
types: [closed]
jobs:
publish:
if: startsWith(github.head_ref, 'releases/') && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout and Setup Node
uses: ./.github/actions/checkout-and-setup
- name: Build package
run: pnpm package
- name: Publish package to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
create_release:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare checkout token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
private_key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}
- name: Create Release
run: |
version=`cat ./package.json | jq -r .version`
echo "latest version: $version"
tag="v$version"
echo "creating release: $tag"
gh release create $tag --generate-notes
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}