-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (80 loc) · 2.95 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Run Release Manager
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: ${{ github.head_ref }}
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
# Pull all previous tags
fetch-depth: 0
fetch-tags: true
- name: Conventional Changelog Action
id: conventional-changelog
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ secrets.GH_TOKEN }}
skip-git-pull: true
skip-version-file: true
git-push: false
skip-on-empty: false # Always create commit
- name: Bump package.json Version
working-directory: ./node/src
run: |
TAG=${{ steps.conventional-changelog.outputs.tag }}
VERSION=${TAG#v}
echo "Bumping npm package version to $VERSION"
npm version $VERSION --no-git-tag-version
- name: Commit package.json Version
working-directory: ./node/src
run: |
TAG=${{ steps.conventional-changelog.outputs.tag }}
VERSION=${TAG#v}
git add package.json
git commit -m "chore(release): bump npm package version to $VERSION [skip ci]"
- name: Push Conventional Changelog
uses: ad-m/github-push-action@master
id: push
with:
github_token: ${{ secrets.GH_TOKEN }}
branch: ${{ github.ref }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.conventional-changelog.outputs.tag }}
body: ${{ steps.conventional-changelog.outputs.changelog }}
token: ${{ secrets.GH_TOKEN }}
makeLatest: true
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal && source ~/.cargo/env
- name: Install build dependencies
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld protobuf-compiler
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Build wasm binary
run: wasm-pack build --release --target deno --no-typescript crates/proof-of-sql-sdk-wasm
- name: Build javascript index
run: |
chmod +x ./node/src/build_index.sh
./node/src/build_index.sh crates/proof-of-sql-sdk-wasm/pkg
- name: Set Up Node.js
uses: actions/setup-node@v3
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org/'
scope: '@spaceandtimelabs'
- name: Publish to npm
working-directory: ./node/src
run: |
npm publish --access public --non-interactive