forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: Homebrew and GHA Release (foundry-rs#183)
* feat: simple GHA release flow (cherry picked from commit e462081) * chore: pull in brew job to release workflow Co-authored-by: Odysseas Lamtzidis <[email protected]>
- Loading branch information
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Release version | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
jobs: | ||
# this job builds the `forge` and `cast` binaries for the specified platforms | ||
# in the matrix. The MacOS binaries do not support M1 yet: https://github.com/actions/runner/issues/805 | ||
build-artifacts: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
with: | ||
cache-on-failure: true | ||
- name: cargo build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
|
||
- name: Upload production artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: target-${{ matrix.os }} | ||
path: | | ||
./target/release/forge | ||
./target/release/cast | ||
# creates a GH release with the built binaries and CHANGELOG entry | ||
create-release: | ||
runs-on: ubuntu-latest | ||
needs: build-artifacts | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1000 | ||
|
||
- name: Set output | ||
id: vars | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
|
||
- name: Restore artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Build Changelog | ||
id: github_release | ||
uses: mikepenz/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Create Release | ||
id: create-release | ||
uses: softprops/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.vars.outputs.tag }} | ||
release_name: ${{ github.ref }} | ||
body: ${{steps.build_changelog.outputs.changelog}} | ||
files: | | ||
./target-macos-latest | ||
./target-ubuntu-latest | ||
# after the GH release is done, proceed to open a PR on homebrew-core | ||
publish-homebrew: | ||
runs-on: ubuntu-latest | ||
needs: build-artifacts | ||
steps: | ||
- name: Create homebrew-core PR | ||
uses: mislav/[email protected] | ||
with: | ||
formula-name: foundry | ||
env: | ||
COMMITTER_TOKEN: ${{ secrets.GH_TOKEN }} |