Skip to content

Added version command and build files #2

Added version command and build files

Added version command and build files #2

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
jobs:
build-release:
name: build-release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- x86_64-apple-darwin
- aarch64-apple-darwin
toolchain: [stable]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
use-cross: true
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
use-cross: true
- os: macos-latest
target: x86_64-apple-darwin
use-cross: false
- os: macos-11
target: aarch64-apple-darwin
use-cross: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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@v2
with:
key: v1-${{ matrix.target }}
- name: Build release binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
use-cross: ${{ matrix.use-cross }}
- name: Build archive
shell: bash
run: |
VERSION="${GITHUB_REF#refs/tags/}"
ARCHIVE="chimney-$VERSION-${{ matrix.target }}.tar.gz"
cp "target/${{ matrix.target }}/release/chimney" "chimney"
tar -czvf "$ARCHIVE" "chimney"
rm chimney
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