CI #52
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: | |
workflow_dispatch: | |
push: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
matrix: | |
oss: | |
- ubuntu-latest | |
- windows-latest | |
runs-on: oss | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache Target | |
if: ${{ ! startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./target | |
~/.cargo | |
key: ci-${{ runner.os }}-${{ hashFiles('./Cargo.lock') }} | |
restore-keys: | | |
ci-${{ runner.os }}-${{ hashFiles('./Cargo.lock') }} | |
ci-${{ runner.os }}- | |
- name: Download Dependencies | |
run: | | |
cargo install --debug cargo-make | |
cargo make ci | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: artifacts | |
retention-days: 5 | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: ./artifacts | |
- name: UPX compress | |
run: | | |
chmod +x ./artifacts/* | |
curl -OL https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-amd64_linux.tar.xz | |
tar -xf upx-4.2.4-amd64_linux.tar.xz | |
cp ./upx-4.2.4-amd64_linux/upx . | |
./upx ./artifacts/* | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
artifacts/* |