Skip to content

Commit c94258d

Browse files
Autoparallellonerapier
authored andcommitted
use Semantic Release
1 parent c086529 commit c94258d

File tree

4 files changed

+66
-16
lines changed

4 files changed

+66
-16
lines changed

.github/workflows/artifacts.yaml

+7-16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
name: build-circuits
22

3-
concurrency:
4-
group: ${{ github.workflow }}-${{ github.ref }}
5-
cancel-in-progress: true
6-
73
on:
8-
push:
9-
branches: [ "main" ]
4+
release:
5+
types: [published]
106
pull_request:
117
branches: [ "main" ]
128

@@ -47,7 +43,7 @@ jobs:
4743
4844
- name: Install Node.js dependencies
4945
run: |
50-
npm install
46+
npm ci
5147
5248
- name: Get package version
5349
id: package_version
@@ -137,18 +133,13 @@ jobs:
137133
path: artifacts/
138134
retention-days: 5
139135

140-
# Create Release only on push to main
141-
- name: Create Release
142-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
136+
# Add artifacts to existing release
137+
- name: Upload Release Asset
138+
if: github.event_name == 'release'
143139
uses: softprops/action-gh-release@v1
144140
with:
145141
files: circom-artifacts-v${{ env.VERSION }}.zip
146-
name: Circuit Artifacts v${{ env.VERSION }}
147-
tag_name: v${{ env.VERSION }}
148-
body: |
149-
Automated release of compiled Circom circuits
150-
Version: ${{ env.VERSION }}
151-
Commit: ${{ github.sha }}
142+
tag_name: ${{ github.ref }}
152143
env:
153144
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154145

.github/workflows/release.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
issues: write
12+
13+
jobs:
14+
release:
15+
name: Release
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "lts/*"
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: npx semantic-release

.releaserc.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// .releaserc.js
2+
module.exports = {
3+
branches: ['main'],
4+
plugins: [
5+
'@semantic-release/commit-analyzer',
6+
'@semantic-release/release-notes-generator',
7+
'@semantic-release/npm',
8+
'@semantic-release/github',
9+
[
10+
'@semantic-release/git',
11+
{
12+
assets: ['package.json'],
13+
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
14+
}
15+
]
16+
]
17+
};

package.json

+8
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,13 @@
55
"dependencies": {
66
"parser-attestor": "github:pluto/parser-attestor#b9feeeb240ddf867da85198de7d59e73cba4b008",
77
"aes-proof": "github:pluto/aes-proof#1d08e13ea4f381649cdff83f56d93444008b6548"
8+
},
9+
"devDependencies": {
10+
"@semantic-release/commit-analyzer": "^11.1.0",
11+
"@semantic-release/git": "^10.0.1",
12+
"@semantic-release/github": "^9.2.6",
13+
"@semantic-release/npm": "^11.0.2",
14+
"@semantic-release/release-notes-generator": "^12.1.0",
15+
"semantic-release": "^23.0.2"
816
}
917
}

0 commit comments

Comments
 (0)