forked from coral-xyz/anchor
-
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.
Build and publish multi-platform binaries for all tags.
- Loading branch information
1 parent
fc9fd6d
commit 0bca136
Showing
3 changed files
with
100 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
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,98 @@ | ||
name: Publish a release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
CROSS_VERSION: 0.2.5 | ||
|
||
jobs: | ||
release-linux: | ||
name: Release (Linux) | ||
runs-on: buildjet-32vcpu-ubuntu-2004 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Install cross | ||
uses: supplypike/setup-bin@v3 | ||
with: | ||
uri: "https://github.com/cross-rs/cross/releases/download/v${{ env.CROSS_VERSION }}/cross-x86_64-unknown-linux-musl.tar.gz" | ||
name: "cross" | ||
version: "${{ env.CROSS_VERSION }}" | ||
|
||
- name: Build (Linux amd64) | ||
run: | | ||
cargo clean | ||
cross build --release --target x86_64-unknown-linux-musl | ||
cp target/x86_64-unknown-linux-musl/release/anchor \ | ||
anchor-linux-amd64 | ||
- name: Build (Linux arm64) | ||
run: | | ||
cargo clean | ||
cross build --release --target aarch64-unknown-linux-musl | ||
cp target/aarch64-unknown-linux-musl/release/anchor \ | ||
anchor-linux-arm64 | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
token: ${{ secrets.PAT_TOKEN }} | ||
files: | | ||
anchor-linux-amd64 | ||
anchor-linux-arm64 | ||
release-macos: | ||
name: Release (macOS) | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Install Rust aarch64-apple-darwin target | ||
run: | | ||
rustup target add aarch64-apple-darwin | ||
- name: Build (macOS amd64) | ||
run: | | ||
cargo build --release --target x86_64-apple-darwin | ||
cp target/x86_64-apple-darwin/release/anchor \ | ||
anchor-macos-amd64 | ||
- name: Build (macOS arm64) | ||
run: | | ||
cargo build --release --target aarch64-apple-darwin | ||
cp target/aarch64-apple-darwin/release/anchor \ | ||
anchor-macos-arm64 | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
token: ${{ secrets.PAT_TOKEN }} | ||
files: | | ||
anchor-macos-amd64 | ||
anchor-macos-arm64 |
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