|
1 | | -name: Releases |
2 | | - |
| 1 | +name: Release |
3 | 2 | on: |
4 | 3 | push: |
5 | | - branches: [ master, develop ] |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - pre |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read # for checkout |
| 10 | + |
6 | 11 | jobs: |
7 | | - build: |
| 12 | + release: |
| 13 | + name: Release |
8 | 14 | runs-on: ubuntu-latest |
9 | | - if: "!contains(github.event.head_commit.message, '[skip ci]')" |
| 15 | + permissions: |
| 16 | + contents: write # to be able to publish a GitHub release |
| 17 | + issues: write # to be able to comment on released issues |
| 18 | + pull-requests: write # to be able to comment on released pull requests |
| 19 | + id-token: write # to enable use of OIDC for npm provenance |
10 | 20 | steps: |
11 | | - - uses: actions/checkout@v2 |
12 | | - - uses: actions/setup-node@v1 |
13 | | - with: |
14 | | - node-version: '18.x' |
15 | | - - run: npm i -g pnpm |
16 | | - - run: pnpm install --frozen-lockfile |
17 | | - - run: pnpm test |
18 | | - - run: pnpm build |
19 | | - - run: yarn pack --filename=release.tgz |
20 | | - - name: Publish on NPM |
21 | | - if: "!contains(github.event.head_commit.message, '[skip publish]')" |
22 | | - uses: JS-DevTools/npm-publish@v1 |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v3 |
23 | 23 | with: |
24 | | - package: build/package.json |
25 | | - token: '${{ secrets.NPM_TOKEN }}' |
26 | | - - uses: Klemensas/action-autotag@stable |
27 | | - if: "!contains(github.event.head_commit.message, '[skip publish]')" |
28 | | - id: update_tag |
| 24 | + fetch-depth: 0 |
| 25 | + - name: Setup Node.js |
| 26 | + uses: actions/setup-node@v3 |
29 | 27 | with: |
30 | | - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' |
31 | | - tag_prefix: 'v' |
32 | | - - name: Create Release |
33 | | - if: "!contains(github.event.head_commit.message, '[skip publish]') && steps.update_tag.outputs.tagname" |
34 | | - uses: actions/create-release@v1 |
35 | | - id: create_release |
| 28 | + node-version: '18' |
| 29 | + - name: Install PNPM |
| 30 | + run: npm i -g pnpm |
| 31 | + - name: Install dependencies |
| 32 | + run: pnpm install --frozen-lockfile |
| 33 | + - name: Build Package |
| 34 | + run: pnpm build |
| 35 | + # - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies |
| 36 | + # run: npm audit signatures |
| 37 | + - name: Semantic Release |
36 | 38 | env: |
37 | 39 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
38 | | - with: |
39 | | - tag_name: ${{ steps.update_tag.outputs.tagname }} |
40 | | - release_name: Release ${{ steps.update_tag.outputs.tagname }} |
41 | | - - name: Upload Release Asset |
42 | | - if: "!contains(github.event.head_commit.message, '[skip publish]') && steps.update_tag.outputs.tagname" |
43 | | - id: upload-release-asset |
44 | | - uses: actions/upload-release-asset@v1 |
45 | | - env: |
46 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
47 | | - with: |
48 | | - upload_url: ${{ steps.create_release.outputs.upload_url }} |
49 | | - asset_path: ./release.tgz |
50 | | - asset_name: release.tgz |
51 | | - asset_content_type: application/tgz |
| 40 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 41 | + run: npx semantic-release |
0 commit comments