44 push :
55 branches :
66 - main
7+ workflow_dispatch :
8+ # Dev publishing
79
810concurrency : ${{ github.workflow }}-${{ github.ref }}
911
@@ -13,23 +15,21 @@ jobs:
1315 runs-on : ubuntu-latest
1416 steps :
1517 - name : Checkout Repo
16- uses : actions/checkout@v4
18+ uses : actions/checkout@v5
1719 - name : Setup Node.js
18- uses : actions/setup-node@v4
20+ uses : actions/setup-node@v5
1921 with :
2022 node-version-file : " .nvmrc"
21- - uses : pnpm/action-setup@v2
23+ - uses : pnpm/action-setup@v4
2224 name : Install pnpm
2325 with :
24- # Pnpm 9.4 introduces this https://github.com/pnpm/pnpm/pull/7633
25- # which causes workspace:^1.2.0 to be converted to 1.2.0^1.2.0
26- version : 9.3
26+ version : latest
2727 run_install : false
2828 - name : Get pnpm store directory
2929 shell : bash
3030 run : |
3131 echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
32- - uses : actions/cache@v3
32+ - uses : actions/cache@v4
3333 name : Setup pnpm cache
3434 with :
3535 path : ${{ env.STORE_PATH }}
@@ -50,14 +50,25 @@ jobs:
5050 version : 4.0.10
5151 actions-cache-folder : " emsdk-cache"
5252
53+ - name : Build
54+ run : pnpm build
55+
5356 - name : Create Release Pull Request or Publish to npm
5457 id : changesets
5558 uses : changesets/action@v1
59+ if : ${{ github.event_name == 'push' }}
5660 with :
5761 # Update the monorepo lockfile after versioning
5862 version : pnpm changeset:version
5963 # This expects you to have a script called release which does a build for your packages and calls changeset publish
6064 publish : pnpm release
6165 env :
6266 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
67+
68+ - name : Dev publish
69+ if : ${{ github.event_name == 'workflow_dispatch' }}
70+ run : |
71+ pnpm changeset version --no-git-tag --snapshot dev
72+ pnpm changeset publish --tag dev
73+ env :
74+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments