* build.yml #2
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
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- releases | |
# paths: | |
# - 'src/**' | |
# - 'Cargo.toml' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
repository-projects: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --release --verbose | |
- name: install cargo-deb | |
run: cargo install cargo-deb | |
- name: install cargo-generate-rpm | |
run: cargo install cargo-generate-rpm | |
- name: Generate DEB package | |
run: cargo deb | |
- name: Generate RPM package | |
run: cargo generate-rpm | |
- name: get version | |
id: get_version | |
run: echo "version=$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "grp") | .version')" >> $GITHUB_ENV | |
- uses: AButler/[email protected] | |
name: Upload release assets | |
with: | |
files: "target/debian/grp*.deb;target/generate-rpm/grp*.rpm" | |
repo-token: ${{ github.token }} | |
release-tag: "v${{ env.version }}-alpha" |