Skip to content

Commit 7d24ab7

Browse files
committed
Added release workflow.
1 parent 616f472 commit 7d24ab7

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

.github/workflows/dev-packages.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
# Packages are versioned as `0.0.0-{tag}-DATETIMESTAMP`
33
name: Create Dev Release
44

5-
# on: workflow_dispatch
6-
on:
7-
push:
5+
on: workflow_dispatch
86

97
jobs:
108
publish:

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@v4
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version-file: ".nvmrc"
21+
- uses: pnpm/action-setup@v2
22+
name: Install pnpm
23+
with:
24+
# Pnpm 9.4 introduces this https://github.com/pnpm/pnpm/pull/7633
25+
# which causes workspace:^1.2.0 to be converted to 1.2.0^1.2.0
26+
version: 9.3
27+
run_install: false
28+
- name: Get pnpm store directory
29+
shell: bash
30+
run: |
31+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
32+
- uses: actions/cache@v3
33+
name: Setup pnpm cache
34+
with:
35+
path: ${{ env.STORE_PATH }}
36+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
37+
restore-keys: |
38+
${{ runner.os }}-pnpm-store-
39+
- name: Install dependencies
40+
run: pnpm install
41+
42+
- name: Install sha3sum
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y libdigest-sha3-perl
46+
47+
- name: Setup Emscripten
48+
uses: mymindstorm/setup-emsdk@v14
49+
with:
50+
version: "latest"
51+
actions-cache-folder: "emsdk-cache"
52+
53+
- name: Create Release Pull Request or Publish to npm
54+
id: changesets
55+
uses: changesets/action@v1
56+
with:
57+
# Update the monorepo lockfile after versioning
58+
version: pnpm changeset:version
59+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
60+
publish: pnpm release
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"scripts": {
2525
"build": "sh build.sh",
2626
"ci:publish": "pnpm publish -r",
27-
"clean": "rm -rf dist sql.js"
27+
"changeset:version": "pnpm changeset version && pnpm install --lockfile-only --frozen-lockfile=false",
28+
"clean": "rm -rf dist sql.js",
29+
"release": "pnpm build && pnpm changeset publish"
2830
},
2931
"devDependencies": {
3032
"@changesets/cli": "^2.29.5"

0 commit comments

Comments
 (0)