-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
62 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,62 @@ | ||
name: 'Publish cargo-concordium binaries' | ||
on: | ||
# The release action always requires a tag to publish a release. | ||
# This job will run when a releases/cargo-concordium/$VERSION | ||
# tag is created. | ||
push: | ||
tags: | ||
- releases/cargo-concordium/*.*.* | ||
branches: | ||
- release/3.3.0 | ||
|
||
jobs: | ||
build: | ||
name: build ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
platform: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Support longpaths on Windows | ||
if: matrix.platform == 'windows-latest' | ||
run: git config --system core.longpaths true | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install rust toolchain | ||
uses: dtolnay/rust-toolchain@1.74 | ||
- name: Build on ubuntu | ||
if: matrix.platfrom == 'ubuntu-latest' | ||
run: | | ||
rustup target add x86_64-unknown-linux-musl | ||
cargo build --release --manifest-path cargo-concordium/Cargo.toml --target x86_64-unknown-linux-musl | ||
- name: Build on other platforms | ||
if: matrix.platfrom != 'ubuntu-latest' | ||
run: cargo build --release --manifest-path cargo-concordium/Cargo.toml | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binary-${{ matrix.platform }} | ||
path: | | ||
cargo-concordium/target/release/cargo-concordium | ||
cargo-concordium/target/release/x86_64-unknown-linux-musl/cargo-concordium | ||
cargo-concordium/target/release/cargo-concordium.exe | ||
release: | ||
permissions: | ||
contents: write | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- run: | | ||
mv binary-macos-latest/cargo-concordium cargo-concordium-darwin-amd64 | ||
mv binary-windows-latest/cargo-concordium.exe cargo-concordium-windows-amd64.exe | ||
mv binary-ubuntu-latest/cargo-concordium cargo-concordium-linux-amd64 | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: true | ||
files: | | ||
cargo-concordium-* |