Added workflow to build releases #27
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: Build and Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
permissions: | ||
contents: write | ||
actions: read | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
ext: so | ||
file_name: partitioner-${{ matrix.target }}.${{ matrix.ext }} | ||
Check failure on line 21 in .github/workflows/release.yml GitHub Actions / Build and ReleaseInvalid workflow file
|
||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
ext: dylib | ||
file_name: partitioner-${{ matrix.target }}.${{ matrix.ext }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
target: ${{ matrix.target }} | ||
override: true | ||
- name: Build Release | ||
run: | | ||
cargo build --release --target ${{ matrix.target }} | ||
artifact_name="partitioner-${{ matrix.target }}.${{ matrix.ext }}" | ||
mv "./target/${{ matrix.target }}/release/libpartitioner.${{ matrix.ext }}" "./target/${{ matrix.target }}/release/$artifact_name" | ||
echo "ARTIFACT_NAME=$artifact_name" >> $GITHUB_ENV | ||
- name: Upload files to a GitHub release | ||
uses: svenstaro/[email protected] | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: target/release/${{ matrix.file_name }} | ||
asset_name: ${{ matrix.file_name }} | ||
tag: ${{ github.ref }} |