generated from samualtnorman/typescript-template
-
Notifications
You must be signed in to change notification settings - Fork 1
23 lines (19 loc) · 955 Bytes
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
name: Publish
on: { push: { branches: [ main ] }, release: { types: [ created ] } }
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- { name: Checkout, uses: actions/checkout@v4 }
- { name: Setup Node.js environment, uses: actions/setup-node@v4, with: { node-version: ^18 || >=20 } }
- { name: Setup pnpm, uses: pnpm/action-setup@v3, with: { version: ^9.0.4, run_install: true } }
- run: git config --global user.email [email protected]
- run: git config --global user.name "Github Action"
- run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- name: Publish dev
if: github.event_name == 'push'
run: scripts/version-dev.js && scripts/package.sh && cd dist && npm publish --no-git-checks --tag dev
- name: Publish release
if: github.event_name == 'release'
run: scripts/package.sh && cd dist && npm publish --no-git-checks