1- name : Release
21on :
3- workflow_run :
4- workflows : ["ci"]
5- types :
6- - completed
2+ push :
73 branches :
84 - master
5+
96permissions :
10- contents : write # to be able to publish a GitHub release
11- issues : write # to be able to comment on released issues
12- pull-requests : write # to be able to comment on released pull requests
13- id-token : write # to enable use of OIDC for tru
7+ contents : write
8+ pull-requests : write
9+ id-token : write
10+
11+ name : release-please
12+
1413jobs :
15- release :
16- name : Release
14+ release-please :
1715 runs-on : ubuntu-latest
18- if : ${{ github.event.workflow_run.conclusion == 'success' }}
1916 steps :
20- - name : Check out Git repository
21- uses : actions/checkout@v3
17+ - uses : google-github-actions/release-please-action@v3
18+ id : release
2219 with :
23- fetch-depth : 0
24- persist-credentials : false
25-
20+ release-type : node
21+ package-name : " @workadventure/simple-peer"
22+ # The logic below handles the npm publication:
23+ - uses : actions/checkout@v2
24+ # these if statements ensure that a publication only occurs when
25+ # a new release is created:
26+ if : ${{ steps.release.outputs.release_created }}
27+ - uses : actions/setup-node@v4
28+ with :
29+ node-version : 20
30+ registry-url : ' https://registry.npmjs.org'
31+ if : ${{ steps.release.outputs.release_created }}
32+ # Upgrade NPM to latest version
33+ - run : npm install -g npm@11
2634 - name : Setup PNPM
2735 uses : pnpm/action-setup@v4
2836 with :
2937 version : 8.8.0
30-
31- - name : Setup Node
32- uses : actions/setup-node@v3
33- with :
34- node-version : ' 20'
35- cache : ' pnpm'
36-
37- # upgrade NPM to a version compatible with Trusted Packages
38- - run : npm install -g npm@11
39-
40- - name : Install dependencies
41- run : pnpm install --frozen-lockfile
42-
43- - name : Build
44- run : pnpm run build
45-
46- - name : Release
38+ - run : pnpm install
39+ if : ${{ steps.release.outputs.release_created }}
40+ - run : pnpm run build
41+ if : ${{ steps.release.outputs.release_created }}
42+ - run : pnpm publish --access public
4743 env :
48- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN }}
49- run : npx semantic- release
44+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN }}
45+ if : ${{ steps. release.outputs.release_created }}
0 commit comments