55 push :
66 branches :
77 - main
8+ - channel/*
89
910permissions :
1011 contents : write
@@ -24,74 +25,24 @@ jobs:
2425 runs-on : ubuntu-latest
2526 steps :
2627 - name : Checkout Repo
27- uses : actions/checkout@v4
28+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2829
29- - name : Setup Node.js
30- uses : actions/setup-node@v4
31- with :
32- node-version-file : " .nvmrc"
33-
34- - name : Install Dependencies
35- run : npm ci
36-
37- - name : Get Commit ID
38- if : ${{ github.event_name == 'workflow_dispatch' }}
39- id : get-commit-id
40- run : |
41- echo "short-commit-id=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
42- echo "commit-id=$(git rev-parse $GITHUB_SHA)" >> $GITHUB_OUTPUT
30+ - name : Setup
31+ uses : ./.github/actions/setup
4332
44- - name : Get Package Name
45- if : ${{ github.event_name == 'workflow_dispatch' }}
46- id : get-package-name
47- run : echo "package-name=$(npm pkg get name | jq -r)" >> $GITHUB_OUTPUT
48-
49- - name : Get Normalized Package Name
50- if : ${{ github.event_name == 'workflow_dispatch' }}
51- id : get-normalized-package-name
52- uses : frabert/replace-string-action@v2
53- with :
54- pattern : " ^.*?([^/]+)$"
55- string : ${{ steps.get-package-name.outputs.package-name }}
56- replace-with : " $1"
57-
58- - name : Patch package.json
59- if : ${{ github.event_name == 'workflow_dispatch' }}
60- run : npm pkg set version=${{ steps.get-commit-id.outputs.short-commit-id }}
61-
62- - name : Build and Pack
63- if : ${{ github.event_name == 'workflow_dispatch' }}
64- run : |
65- npm run prepublishOnly
66- npm pack
67-
68- - name : Draft Release
69- if : ${{ github.event_name == 'workflow_dispatch' }}
70- uses : ncipollo/release-action@v1
71- with :
72- allowUpdates : true
73- artifacts : " ${{ steps.get-normalized-package-name.outputs.replaced }}-${{ steps.get-commit-id.outputs.short-commit-id }}.tgz"
74- artifactContentType : application/gzip
75- body : " This is a draft release of ${{ steps.get-package-name.outputs.package-name }}: ${{ steps.get-commit-id.outputs.short-commit-id }}."
76- commit : ${{ steps.get-commit-id.outputs.commit-id }}
77- tag : " draft"
78- draft : true
79- name : " draft"
80- removeArtifacts : true
33+ - name : Test
34+ run : pnpm -s test
8135
8236 - name : Get Next Package Version
83- if : ${{ github.event_name != 'workflow_dispatch' }}
8437 id : package-version
85- run : echo "version=$(npx changeset status --output=release.json && jq -r '.releases[0].newVersion // '$(npm pkg get version)'' release.json && rm release.json)" >> $GITHUB_OUTPUT
38+ run : echo "version=$(pnpm -s changeset status --output=release.json && jq -r '.releases[0].newVersion // '$(npm pkg get version)'' release.json && rm release.json)" >> $GITHUB_OUTPUT
8639
8740 - name : Create Release Pull Request or Publish to NPM
88- if : ${{ github.event_name != 'workflow_dispatch' }}
8941 id : changesets
90- uses : changesets/action@v1
42+ uses : changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9
9143 with :
92- version : npm run bump
93- publish : npx changeset publish
44+ publish : pnpm -s changeset publish
9445 commit : " chore(release): v${{ steps.package-version.outputs.version }}"
9546 env :
96- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47+ GITHUB_TOKEN : ${{ secrets.CHANGESET_TOKEN }}
9748 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments