v0.2.5 #21
Workflow file for this run
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
name: Build and upload assets | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# Build gnu-linux on ubuntu-18.04 and musl on ubuntu latest | |
os: [ ubuntu-20.04, ubuntu-latest, windows-latest, macos-latest ] | |
name: Building, ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Install toolchain | |
id: rust-toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- name: Install protoc | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: protoc | |
- name: Create bin directory | |
run: mkdir bin | |
- name: Build on Linux GNU | |
if: matrix.os == 'ubuntu-20.04' | |
# We're using musl to make the binaries statically linked and portable | |
run: | | |
cargo build --target=x86_64-unknown-linux-gnu --release | |
asset_name="kaspa-miner-${{ github.event.release.tag_name }}-linux-gnu-amd64" | |
strip ./target/x86_64-unknown-linux-gnu/release/kaspa-miner | |
mv ./target/x86_64-unknown-linux-gnu/release/kaspa-miner ./bin/${asset_name} | |
- name: Build on Linux musl | |
if: matrix.os == 'ubuntu-latest' | |
# We're using musl to make the binaries statically linked and portable | |
run: | | |
sudo apt-get install -y musl-tools | |
rustup target add x86_64-unknown-linux-musl | |
cargo build --target=x86_64-unknown-linux-musl --release | |
asset_name="kaspa-miner-${{ github.event.release.tag_name }}-linux-musl-amd64" | |
strip ./target/x86_64-unknown-linux-musl/release/kaspa-miner | |
mv ./target/x86_64-unknown-linux-musl/release/kaspa-miner ./bin/${asset_name} | |
- name: Build on Windows | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
run: | | |
cargo build --target=x86_64-pc-windows-msvc --release | |
asset_name="kaspa-miner-${{ github.event.release.tag_name }}-win64-amd64.exe" | |
mv ./target/x86_64-pc-windows-msvc/release/kaspa-miner.exe ./bin/${asset_name} | |
- name: Build on MacOS for x86_64 | |
if: matrix.os == 'macos-latest' | |
run: | | |
cargo build --target=x86_64-apple-darwin --release | |
asset_name="kaspa-miner-${{ github.event.release.tag_name }}-osx-amd64" | |
mv ./target/x86_64-apple-darwin/release/kaspa-miner ./bin/${asset_name} | |
- name: Build on MacOS for M1/2 | |
if: matrix.os == 'macos-latest' | |
run: | | |
rustup target add aarch64-apple-darwin | |
cargo build --target=aarch64-apple-darwin --release | |
asset_name="kaspa-miner-${{ github.event.release.tag_name }}-osx-aarch64" | |
mv ./target/aarch64-apple-darwin/release/kaspa-miner ./bin/${asset_name} | |
- name: Upload release asset | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
bin/* |