Skip to content

Commit 2d2212e

Browse files
authored
Merge pull request #66 from enulus/add-ci-workflows
New: CI workflows for PR validation and release publish
2 parents 35cf8ec + fd61711 commit 2d2212e

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12+
13+
jobs:
14+
validate:
15+
name: validate
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: '22'
24+
cache: 'npm'
25+
26+
- run: npm ci
27+
28+
- run: npm run build:check
29+
30+
- run: npm run build
31+
32+
- run: npm test

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
if: ${{ !github.event.release.prerelease }}
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.release.tag_name }}
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '22'
25+
registry-url: 'https://registry.npmjs.org'
26+
cache: 'npm'
27+
28+
- run: npm ci
29+
30+
- run: npm run build
31+
32+
- run: npm test
33+
34+
- run: npm publish --provenance --access public

0 commit comments

Comments
 (0)