Skip to content

Commit

Permalink
remove semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
lonerapier committed Oct 30, 2024
1 parent ad5abea commit 73ed184
Show file tree
Hide file tree
Showing 5 changed files with 686 additions and 8,163 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,36 @@ on:
branches: [ "main" ]

jobs:
check-version:
name: Check package.json version update
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2 # Fetch two commits to get the base branch

- name: Fetch main branch
run: |
git fetch origin main
- name: Compare package.json version with main
id: version_check
run: |
# Extract version from package.json in PR branch
PR_VERSION=$(jq -r .version package.json)
# Extract version from package.json in main branch
MAIN_VERSION=$(git show origin/main:package.json | jq -r .version)
echo "PR version: $PR_VERSION"
echo "Main version: $MAIN_VERSION"
# Fail if versions match
if [ "$PR_VERSION" == "$MAIN_VERSION" ]; then
echo "Error: package.json version has not been updated in this PR."
exit 1
else
echo "package.json version has been updated in this PR."
fi
build:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -79,14 +109,14 @@ jobs:
- name: Create release artifacts
run: |
cd artifacts
zip -r ../circom-artifacts.zip ./*
zip -r ../circom-artifacts-v${{ env.VERSION }}.zip ./*
cd ..
# Upload artifacts for PR
- name: Upload artifacts for PR
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: circom-artifacts
path: circom-artifacts.zip
name: circom-artifacts-v${{ env.VERSION }}
path: circom-artifacts-v${{ env.VERSION }}.zip
retention-days: 5
53 changes: 19 additions & 34 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,13 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

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

jobs:
verify:
name: Verify semantic release
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
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: Verify semantic release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release --dry-run
release:
name: Release
runs-on: ubuntu-latest
Expand All @@ -57,6 +30,12 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Get package version
id: package_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Get Latest Successful build-circuits Run ID
id: get_run_id
env:
Expand All @@ -70,15 +49,21 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: circom-artifacts
name: circom-artifacts-v${{ env.VERSION }}
path: .
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.run_id }}

- name: Release

# Add artifacts to existing release
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: circom-artifacts-v${{ env.VERSION }}.zip
tag_name: v${{ env.VERSION }}
body: |
Automated release of compiled Circom circuits
Version: ${{ env.VERSION }}
Commit: ${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release
RELEASE_TAG=$(git tag --list --contains HEAD | tail -1)
gh release upload $RELEASE_TAG "circom-artifacts.zip"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 0 additions & 17 deletions .releaserc.js

This file was deleted.

Loading

0 comments on commit 73ed184

Please sign in to comment.