Skip to content

Commit c67a58e

Browse files
committed
add workflow automation for npm releases
1 parent 26c7961 commit c67a58e

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.github/workflows/release.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release all packages with semantic release
2+
3+
permissions:
4+
actions: read
5+
checks: read
6+
contents: write
7+
packages: write
8+
9+
on:
10+
push:
11+
branches:
12+
- main
13+
14+
env:
15+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16+
17+
jobs:
18+
# test:
19+
# uses: ./.github/workflows/tests.yaml
20+
nodejs_release:
21+
# needs:
22+
# - test-ts-sdk
23+
# - test-specification
24+
25+
runs-on: ubuntu-latest
26+
27+
strategy:
28+
matrix:
29+
node-version: [18.14.0]
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
39+
- uses: pnpm/action-setup@v2
40+
name: Install pnpm
41+
id: pnpm-install
42+
with:
43+
version: 7
44+
run_install: false
45+
46+
- name: Get pnpm store directory
47+
id: pnpm-cache
48+
shell: bash
49+
run: |
50+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
51+
52+
- uses: actions/cache@v3
53+
name: Setup pnpm cache
54+
with:
55+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
56+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
57+
restore-keys: |
58+
${{ runner.os }}-pnpm-store-
59+
60+
- name: Install dependencies
61+
run: |
62+
pnpm install;
63+
64+
- name: Release
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
68+
run: npx semantic-release

.releaserc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
branches:
2+
- main

0 commit comments

Comments
 (0)