-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (36 loc) · 1.07 KB
/
publish.yml
File metadata and controls
47 lines (36 loc) · 1.07 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
42
43
44
45
46
47
name: Build and Publish to npm
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Update package.json version
run: npm version ${{ steps.version.outputs.VERSION }} --no-git-tag-version
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Verify build output
run: |
echo "📦 Publishing version ${{ steps.version.outputs.VERSION }}"
ls -la dist/
- name: Publish to npm
run: npm publish --provenance --access public