Skip to content

Commit

Permalink
use Semantic Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoparallel committed Oct 24, 2024
1 parent f83f78a commit 68e60ef
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 16 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: build-circuits

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches: [ "main" ]
release:
types: [published]
pull_request:
branches: [ "main" ]

Expand Down Expand Up @@ -45,7 +41,7 @@ jobs:
- name: Install Node.js dependencies
run: |
npm install
npm ci
- name: Get package version
id: package_version
Expand Down Expand Up @@ -87,17 +83,12 @@ jobs:
path: artifacts/
retention-days: 5

# Create Release only on push to main
- name: Create Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# Add artifacts to existing release
- name: Upload Release Asset
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: circom-artifacts-v${{ env.VERSION }}.zip
name: Circuit Artifacts v${{ env.VERSION }}
tag_name: v${{ env.VERSION }}
body: |
Automated release of compiled Circom circuits
Version: ${{ env.VERSION }}
Commit: ${{ github.sha }}
tag_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
issues: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Install dependencies
run: npm ci

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
17 changes: 17 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// .releaserc.js
module.exports = {
branches: ['main'],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/npm',
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['package.json'],
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}
]
]
};
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
"dependencies": {
"parser-attestor": "github:pluto/parser-attestor#b9feeeb240ddf867da85198de7d59e73cba4b008",
"aes-proof": "github:pluto/aes-proof#1d08e13ea4f381649cdff83f56d93444008b6548"
},
"devDependencies": {
"@semantic-release/commit-analyzer": "^11.1.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.6",
"@semantic-release/npm": "^11.0.2",
"@semantic-release/release-notes-generator": "^12.1.0",
"semantic-release": "^23.0.2"
}
}

0 comments on commit 68e60ef

Please sign in to comment.