-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (39 loc) · 1.26 KB
/
publish.yml
File metadata and controls
41 lines (39 loc) · 1.26 KB
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
name: publish
on:
release:
types: [published]
jobs:
publish:
if: ${{ github.repository_owner == 'maxmilton' }}
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run lint
- run: bun run test
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: latest
registry-url: "https://registry.npmjs.org"
- name: Determine npm tag
run: |
if [[ "${{ github.ref }}" == *"-next."* ]]; then
echo "NPM_TAG=next" >> $GITHUB_ENV
else
echo "NPM_TAG=latest" >> $GITHUB_ENV
fi
- run: npm publish --provenance --access public --tag ${{ env.NPM_TAG }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}