Clean up #88
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-nix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup mold | |
run: | | |
wget https://github.com/rui314/mold/releases/download/v1.7.1/mold-1.7.1-x86_64-linux.tar.gz | |
tar xzf mold-1.7.1-x86_64-linux.tar.gz | |
ls -lhFA mold-1.7.1-x86_64-linux | |
sudo cp mold-1.7.1-x86_64-linux/bin/mold /usr/bin | |
- name: setup gdk-3 and alsa | |
run: | | |
sudo apt-get install -y libgdk-pixbuf2.0-dev libgtk-3-dev libasound2-dev libpulse-dev | |
- name: setup cache | |
uses: actions/[email protected] | |
with: | |
# A list of files, directories, and wildcard patterns to cache and restore | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target/ | |
# An explicit key for restoring and saving the cache | |
key: ${{ runner.os }}-build-nix-${{ github.ref_name }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-nix- | |
- name: build | |
run: cargo build --verbose --release | |
- name: compress executable | |
uses: crazy-max/[email protected] | |
with: | |
version: v3.95 | |
args: --best --lzma --color -v -o afx.upx | |
files: | | |
target/release/afx | |
- name: upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binaries | |
retention-days: 90 | |
path: | | |
afx.upx | |
target/release/afx | |
- name: test | |
run: cargo test --verbose --release | |
release: | |
needs: build-nix | |
if: ${{ github.ref == 'refs/heads/main' }} | |
concurrency: | |
group: release | |
cancel-in-progress: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: binaries | |
path: binaries/ | |
- name: delete release | |
continue-on-error: true | |
run: gh release delete latest --cleanup-tag | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: create release | |
uses: softprops/action-gh-release@v2 | |
id: create-release | |
with: | |
draft: true | |
prerelease: true | |
fail_on_unmatched_files: true | |
files: | | |
binaries/* | |
name: afx preview | |
tag_name: latest | |
- name: publish release | |
uses: eregon/publish-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
release_id: ${{ steps.create-release.outputs.id }} |