-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (38 loc) · 1.1 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
name: publish
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
id-token: write
steps:
- name: Check valid version tag
run: |
[[ "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-next.[0-9]+)? ]] || exit 1
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run lint
- run: bun run test
- uses: actions/setup-node@v4
with:
node-version: latest
registry-url: 'https://registry.npmjs.org'
- name: Determine npm tag
id: npm_tag
run: |
if [[ "${{ github.ref }}" == *"-next."* ]]; then
echo "::set-output name=tag_name::next"
else
echo "::set-output name=tag_name::latest"
fi
- run: npm publish --provenance --access public --tag ${{ steps.npm_tag.outputs.tag_name }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}