Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 31a3572

Browse files
committed
CI workflow
1 parent bd9d784 commit 31a3572

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
release:
8+
types: [published]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 18
23+
cache: npm
24+
25+
- run: npm ci
26+
- run: npm run build
27+
28+
- name: Test creation from template
29+
run: |
30+
./build/index.js test-server --name test-server --description "Here is a test server"
31+
32+
- name: Validate generated project
33+
run: npm install && npm run build && npm link
34+
working-directory: test-server
35+
36+
publish:
37+
runs-on: ubuntu-latest
38+
if: github.event_name == 'release'
39+
environment: release
40+
needs: build
41+
42+
permissions:
43+
contents: read
44+
id-token: write
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-node@v4
49+
with:
50+
node-version: 18
51+
cache: npm
52+
registry-url: 'https://registry.npmjs.org'
53+
54+
- run: npm ci
55+
56+
# TODO: Add --provenance once the repo is public
57+
- run: npm publish --access public
58+
env:
59+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)