feat: Enhance the CI process #8
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: CI | |
on: | |
push: | |
branches: [ "canary", "[0-9]+-[0-9]+-[0-9]+" ] | |
pull_request: | |
branches: [ "canary" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: fmt | |
run: cargo fmt --check --verbose | |
- name: clippy | |
run: cargo clippy -- -D warnings --verbose | |
- name: build | |
run: cargo build --verbose | |
- name: test | |
run: cargo test --verbose | |
release: | |
name: Release Build and Publish | |
# if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
job: | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
use-cross: false | |
- os: macos-13 | |
target: x86_64-apple-darwin | |
use-cross: false | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
use-cross: false | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
use-cross: false | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
use-cross: true | |
- os: ubuntu-latest | |
target: i686-unknown-linux-gnu | |
use-cross: true | |
- os: ubuntu-latest | |
target: arm-unknown-linux-gnueabihf | |
use-cross: true | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
use-cross: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add Cross Compilation Targets | |
run: | | |
rustup target add ${{ matrix.job.target }} | |
- name: Build Release Binary | |
run: cargo build --release --target ${{ matrix.job.target }} | |
- name: Archive Binary | |
run: | | |
mkdir -p dist | |
if [[ "${{ matrix.job.os }}" == "windows-latest" ]]; then | |
cp target/${{ matrix.job.target }}/release/katharsis.exe dist/katharsis-${{ matrix.job.target }}.exe | |
else | |
cp target/${{ matrix.job.target }}/release/katharsis dist/katharsis-${{ matrix.job.target }} | |
fi | |
# - name: Upload Binary to GitHub Releases | |
# uses: softprops/action-gh-release@v1 | |
# with: | |
# files: dist/* | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |