Skip to content

Commit

Permalink
feat(ci)!: Change release workflow to use release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jan 30, 2023
1 parent d4316ca commit 0a2cc84
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 48 deletions.
92 changes: 44 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,54 @@
name: Publish
# <arch>-<vendor>-<os>-<env>
# For esoteric targets, there is probably a succint way to do it with a target array
# Alternatively, we can wait for action-rs to get a v2, where we can input 'targets'
name: Release

on:
push:
tags:
- 'v*'
branches:
- master

jobs:
publish:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
name: [
linux,
windows,
macos
]

include:
- name: linux
os: ubuntu-20.04
artifact_name: nargo
asset_name: nargo-linux
- name: windows
os: windows-latest
artifact_name: nargo.exe
asset_name: nargo-windows
- name: macos
os: macos-latest
artifact_name: nargo
asset_name: nargo-macos
release-please:
name: Create Release
outputs:
release-pr: ${{ steps.release.outputs.pr }}
runs-on: ubuntu-latest
steps:
- name: Run release-please
id: release
uses: google-github-actions/release-please-action@v3
with:
release-type: simple
package-name: noir
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
pull-request-title-pattern: "chore(noir): Release ${version}"
extra-files: |
Cargo.toml
update-lockfile:
name: Update lockfile
needs: [release-please]
if: ${{ needs.release-please.outputs.release-pr }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout release branch
uses: actions/checkout@v3
with:
ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.65.0

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Update lockfile
run: |
cargo update --workspace
- name: Build
run: cargo build --release --locked
- name: Configure git
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}-${{ steps.previoustag.outputs.tag }}
tag: ${{ github.ref }}
- name: Commit updates
run: |
git add Cargo.lock
git commit -m 'chore: Update lockfile'
git push
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ exclude = ["examples/9/merkle_tree_processor"]
default-members = ["crates/nargo"]

[workspace.package]
# x-release-please-start-version
version = "0.1.0"
# x-release-please-end
authors = ["Kevaundray Wedderburn <kevtheappdev@gmail.com>"]
edition = "2021"
rust-version = "1.64"
Expand Down

0 comments on commit 0a2cc84

Please sign in to comment.