name: Release
on:
push:
tags:
- '*'
jobs:
unix-release:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-18.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-18.04
target: x86_64-unknown-linux-musl
- os: macos-latest
target: x86_64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set the version
id: version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Build
run: cargo build --release --locked
- name: Strip binary
run: strip target/release/cleora
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/cleora
asset_name: cleora-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}
tag: ${{ github.ref }}
windows-release:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set the version
id: version
run: |
$TAG=${env:GITHUB_REF} -replace 'refs/tags/', ''
echo "::set-output name=VERSION::$TAG"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Build
run: cargo build --release --locked
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/cleora.exe
asset_name: cleora-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}
tag: ${{ github.ref }}