cross-platform release workflow (#7) #1
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*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-pc-windows-gnu | |
- x86_64-apple-darwin | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install cross | |
run: cargo install cross --git https://github.com/cross-rs/cross | |
- name: Build binary | |
run: cross build --release --target ${{ matrix.target }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: target/${{ matrix.target }}/release/affected | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
target/x86_64-unknown-linux-gnu/release/affected | |
target/x86_64-pc-windows-gnu/release/affected.exe | |
target/x86_64-apple-darwin/release/affected | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |