-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
- Loading branch information
Showing
1 changed file
with
43 additions
and
21 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 |
---|---|---|
@@ -1,29 +1,51 @@ | ||
name: Build and Upload Release Binaries | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
types: | ||
- created | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: release ${{ matrix.target }} | ||
runs-on: self-hosted | ||
build_and_upload: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target: x86_64-pc-windows-gnu | ||
archive: zip | ||
- target: x86_64-unknown-linux-musl | ||
archive: tar.gz tar.xz tar.zst | ||
- target: x86_64-apple-darwin | ||
archive: zip | ||
platform: | ||
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl } | ||
- { os: macos-latest, target: x86_64-apple-darwin } | ||
|
||
runs-on: ${{ matrix.platform.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- name: Compile and release | ||
uses: rust-build/rust-build.action@v1.4.4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
RUSTTARGET: ${{ matrix.target }} | ||
ARCHIVE_TYPES: ${{ matrix.archive }} | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Add target | ||
run: rustup target add ${{ matrix.platform.target }} | ||
|
||
- name: Install deps for musl build | ||
if: matrix.platform.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y musl-tools clang build-essential curl llvm-dev libclang-dev linux-headers-generic libsnappy-dev liblz4-dev libzstd-dev libgflags-dev zlib1g-dev libbz2-dev | ||
sudo ln -s /usr/bin/g++ /usr/bin/musl-g++ | ||
- name: Build | ||
run: cargo build --release --target ${{ matrix.platform.target }} | ||
|
||
- name: Upload Binary to Release | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./target/${{ matrix.platform.target }}/release/zepter | ||
asset_name: zepter-${{ matrix.platform.target }} | ||
asset_content_type: application/octet-stream | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |