Build Binaries #1
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: Nightly Build | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
check-changes: | |
runs-on: ubuntu-latest | |
env: | |
CACHE_FILE: ${{ github.workspace }}/.last-built-commit | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- name: Check if relevant code has changed | |
id: changed | |
run: | | |
if git diff --quiet HEAD~1..HEAD -- src/ test/; then | |
echo "::set-output name=changed::true" | |
else | |
echo "::set-output name=changed::false" | |
fi | |
- name: Get last built commit | |
id: last-built | |
if: steps.changed.outputs.changed == 'true' | |
run: | | |
echo "::set-output name=commit::$(cat ${{ env.CACHE_FILE }})" | |
build: | |
name: Build Nightly Release (${{ matrix.os.name }}) | |
runs-on: ${{ matrix.os.runner }} | |
needs: check-changes | |
if: ${{ needs.check-changes.outputs.changed == 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- name: linux | |
runner: ubuntu-latest | |
target: i686-unknown-linux-gnu | |
- name: win | |
runner: windows-latest | |
target: i686-pc-windows-msvc | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: ${{ matrix.os.target }} | |
- name: Build | |
run: cargo build --release --package aneri --target ${{ matrix.os.target }} | |
- name: Cache last built commit | |
id: cache-commit | |
run: | | |
echo "$GITHUB_SHA" > ${{ github.workspace }}/.last-built-commit | |
echo "::set-output name=commit::$GITHUB_SHA" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aneri-${{ matrix.os.name }} | |
if-no-files-found: error | |
path: | | |
target/${{ matrix.os.target }}/release/aneri.dll | |
target/${{ matrix.os.target }}/release/aneri.pdb | |
target/${{ matrix.os.target }}/release/libaneri.so |