Update to version 0.17.0 #18
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: release | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+*" | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-D warnings" | |
jobs: | |
build-release: | |
name: build-release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: | |
- macos | |
- macos-arm64 | |
- windows-64bit | |
toolchain: [stable] | |
include: | |
- build: macos | |
os: macos-latest | |
target: x86_64-apple-darwin | |
- build: macos-arm64 | |
os: macos-11 | |
target: aarch64-apple-darwin | |
- build: windows-64bit | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
target: ${{ matrix.target }} | |
override: true | |
default: true | |
profile: minimal | |
- name: Handle Rust dependencies caching | |
uses: Swatinem/rust-cache@v1 | |
with: | |
key: v2-${{ matrix.target }} | |
- name: Build release binary | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target ${{ matrix.target }} | |
- name: Build archive | |
shell: bash | |
run: | | |
VERSION="${GITHUB_REF#refs/tags/}" | |
if [ "${{ matrix.os }}" = "windows-latest" ]; then | |
ARCHIVE="matcha-$VERSION-${{ matrix.build }}.zip" | |
cp "target/${{ matrix.target }}/release/matcha.exe" "matcha.exe" | |
7z a "$ARCHIVE" "matcha.exe" | |
rm matcha.exe | |
else | |
ARCHIVE="matcha-$VERSION-${{ matrix.build }}.tar.gz" | |
cp "target/${{ matrix.target }}/release/matcha" "matcha" | |
tar -czvf "$ARCHIVE" "matcha" | |
rm matcha | |
fi | |
openssl dgst -r -sha256 -out "$ARCHIVE".sha256 "$ARCHIVE" | |
openssl dgst -r -sha512 -out "$ARCHIVE".sha512 "$ARCHIVE" | |
echo "ASSET=$ARCHIVE" >> $GITHUB_ENV | |
- name: Upload release archive | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
prerelease: false | |
fail_on_unmatched_files: true | |
files: | | |
${{ env.ASSET }} | |
${{ env.ASSET }}.sha256 | |
${{ env.ASSET }}.sha512 | |
build-release-musl: | |
runs-on: ubuntu-latest | |
container: clux/muslrust:stable | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Link to predefined musl toolchain | |
run: | | |
ln -s /root/.cargo $HOME/.cargo | |
ln -s /root/.rustup $HOME/.rustup | |
- name: Handle Rust dependencies caching | |
uses: Swatinem/rust-cache@v1 | |
with: | |
key: v1-linux-musl | |
- name: Build release binary | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- name: Build archive | |
shell: bash | |
run: | | |
VERSION="${GITHUB_REF#refs/tags/}" | |
ARCHIVE="matcha-$VERSION-linux-amd64.tar.gz" | |
cp "target/x86_64-unknown-linux-musl/release/matcha" "matcha" | |
tar -czvf "$ARCHIVE" "matcha" | |
openssl dgst -r -sha256 -out "$ARCHIVE".sha256 "$ARCHIVE" | |
openssl dgst -r -sha512 -out "$ARCHIVE".sha512 "$ARCHIVE" | |
echo "ASSET=$ARCHIVE" >> $GITHUB_ENV | |
- name: Upload release archive | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true | |
prerelease: false | |
fail_on_unmatched_files: true | |
files: | | |
${{ env.ASSET }} | |
${{ env.ASSET }}.sha256 | |
${{ env.ASSET }}.sha512 |