Skip to content

Commit ee52dc0

Browse files
author
Georg Traar
committed
Update GitHub CI
1 parent 0eb49da commit ee52dc0

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Only trigger when a version tag (e.g., v1.0.0) is pushed
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Ensure we fetch all tags
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 18
22+
registry-url: https://registry.npmjs.org/
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Build package
28+
run: npm run build
29+
30+
- name: Publish to npm
31+
run: npm publish --access public
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Run Tests
22

3-
# Trigger the workflow on push or pull request
43
on:
54
push:
65
branches:
@@ -9,23 +8,18 @@ on:
98
branches:
109
- main
1110

12-
# Define the jobs to run
1311
jobs:
1412
test:
15-
# Use the latest Ubuntu environment
1613
runs-on: ubuntu-latest
1714

18-
# Define the steps for this job
1915
steps:
20-
# Checkout the repository
2116
- name: Checkout code
2217
uses: actions/checkout@v3
2318

24-
# Set up Node.js
2519
- name: Set up Node.js
26-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2721
with:
28-
node-version: 18 # Specify your required Node.js version
22+
node-version: 18
2923

3024
- name: Install dependencies
3125
run: npm install

0 commit comments

Comments
 (0)