-
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.
Build and upload binaries for all supported platforms. Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
- Loading branch information
Showing
1 changed file
with
82 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,82 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+*' | ||
# TEMPORARY FOR DEBUGGING, REMOVE BEFORE MERGING THIS PR | ||
branches: | ||
- '*' | ||
|
||
env: | ||
CARGO_INCREMENTAL: 0 | ||
CARGO_NET_RETRY: 10 | ||
RUSTUP_MAX_RETRIES: 10 | ||
MACOSX_DEPLOYMENT_TARGET: 10.7 | ||
# Emit backtraces on panics. | ||
RUST_BACKTRACE: 1 | ||
|
||
jobs: | ||
github_build: | ||
name: Build release binaries | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# List of platforms, this must be in sync with the list of platforms in ci.yaml | ||
- target: x86_64-unknown-linux-gnu | ||
os: ubuntu-latest | ||
name: zinnia-x86_64-unknown-linux-gnu.tar.gz | ||
|
||
- target: x86_64-apple-darwin | ||
os: macOS-11 | ||
name: zinnia-x86_64-apple-darwin.tar.gz | ||
|
||
- target: x86_64-pc-windows-msvc | ||
os: windows-latest | ||
name: zinnia-x86_64-pc-windows-msvc.zip | ||
rustflags: -C target-feature=+crt-static | ||
|
||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
env: | ||
RUSTFLAGS: ${{ matrix.rustflags || '' }} | ||
steps: | ||
- name: Setup | Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup | Rust | ||
uses: actions-rs/toolchain@v1.0.7 | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
target: ${{ matrix.target }} | ||
|
||
- name: Build | Build | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: build | ||
args: --release --locked --target ${{ matrix.target }} | ||
use-cross: ${{ matrix.os == 'ubuntu-latest' }} | ||
|
||
- name: Post Build | Prepare artifacts [Windows] | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
cd target/${{ matrix.target }}/release | ||
7z a ../../../${{ matrix.name }} zinnia.exe | ||
cd - | ||
- name: Post Build | Prepare artifacts [-nix] | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
cd target/${{ matrix.target }}/release | ||
tar czvf ../../../${{ matrix.name }} zinnia | ||
cd - | ||
- name: Release | Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.name }} | ||
path: ${{ matrix.name }} | ||
|