Skip to content

Commit 2a9971b

Browse files
authored
Merge pull request #22 from Project-OMOTES/WouterSpaak/issue21
Set up ci-cd publish
2 parents a4e04ca + 44576b6 commit 2a9971b

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
with:
1919
node-version: 20
2020
cache: 'npm'
21-
- uses: arduino/setup-protoc@v3
2221
- run: npm ci
2322
- run: npx nx affected -t lint --parallel=3 --exclude=demo,demo-server
2423
- run: npx nx affected -t test --parallel=3 --exclude=demo,demo-server

.github/workflows/node_release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ./.github/workflows/publish.yml
2+
name: Publish
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
test:
10+
name: Publish
11+
runs-on: ubuntu-latest
12+
environment: release
13+
permissions:
14+
contents: read
15+
id-token: write # needed for provenance data generation
16+
timeout-minutes: 10
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Install Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
registry-url: https://registry.npmjs.org/
28+
29+
- name: Install dependencies
30+
run: npm install
31+
shell: bash
32+
33+
- name: Print Environment Info
34+
run: npx nx report
35+
shell: bash
36+
37+
- name: Publish to npm
38+
run: |
39+
npx nx affected -t lint --parallel=3 --exclude=demo,demo-server
40+
npx nx affected -t test --parallel=3 --exclude=demo,demo-server
41+
npx nx affected -t build --parallel=3 --exclude=demo,demo-server
42+
cd dist/sdk
43+
npm --no-git-tag-version --force version from-git
44+
npm publish --provenance --access public
45+
env:
46+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 commit comments

Comments
 (0)