-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.53 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Bump version and publish to NPM
on:
push:
branches:
- main
jobs:
versioning:
name: Bump version
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 18
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Build package
run: |
npm install -g yarn
yarn install
yarn build
- name: Register Token
run: |
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > /home/runner/work/_temp/.npmrc
echo "//registry.npmjs.org/:_auth=$NODE_AUTH_TOKEN" >> /home/runner/work/_temp/.npmrc
echo "[email protected]" >> /home/runner/work/_temp/.npmrc
echo "always-auth=true" >> /home/runner/work/_temp/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish
run: npm publish --access public