Files
gt-tool/.gitea/workflows/release.yml
Robert Garrett 641efc3bf7
All checks were successful
/ Compile and upload a release build (release) Successful in 1m10s
Update automation workflow with new CLI args
2025-07-22 09:41:54 -05:00

35 lines
1.2 KiB
YAML

---
on:
release:
types: [published]
jobs:
make-release:
runs-on: ubuntu-latest
name: Compile and upload a release build
steps:
- uses: actions/checkout@v4
- name: Get Cargo version
run: echo "cargo_version=v$(grep "^version" Cargo.toml | cut -d \" -f2)" >> $GITHUB_ENV
- name: Abort if Cargo.toml & Git Tag versions don't match
if: ${{ env.cargo_version != github.ref_name }}
run: exit 1
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Build binary crate
run: cargo build --release
- name: Rename binary to include architecture
run: mv target/release/gt-tool target/release/gt-tool-${{ github.ref_name }}-$(arch)
- name: Upload the program (using itself!)
run: >
target/release/gt-tool-${{ github.ref_name }}-$(arch)
-u ${{ vars.DEST_GITEA }}
-o ${{ vars.DEST_OWNER }}
-r ${{ vars.DEST_REPO }}
upload-release
"${{ github.ref_name }}"
target/release/gt-tool-${{ github.ref_name }}-$(arch)
env:
RELEASE_KEY_GITEA: ${{ secrets.RELEASE_KEY_GITEA }}
...