-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (33 loc) · 1.04 KB
/
node.js.yml
File metadata and controls
43 lines (33 loc) · 1.04 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
name: Build and Publish
on:
push:
tags:
- 'v*' # Runs only when pushing a tag like v1.0.0
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://npm.pkg.github.com'
scope: '@MattterSteege'
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update package.json version
run: npm version ${{ steps.version.outputs.VERSION }} --no-git-tag-version
- name: Install dependencies
run: npm ci
- name: Build package
run: node build.js --as-version ${{ steps.version.outputs.VERSION }} --full-build --github
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}