Files
aare_launcher/.gitea/workflows/release.yaml
T
perl_d e7a4d3caf8
Check and Lint / Check (pull_request) Successful in 19s
Check and Lint / Clippy (pull_request) Successful in 19s
Test and Coverage / Test (pull_request) Successful in 21s
Check and Lint / Rustfmt (pull_request) Successful in 27s
Check and Lint / Build RPM (pull_request) Successful in 31s
Test and Coverage / Coverage (pull_request) Successful in 47s
Check and Lint / Check (push) Successful in 20s
Check and Lint / Rustfmt (push) Successful in 18s
Check and Lint / Clippy (push) Successful in 19s
Check and Lint / Build RPM (push) Successful in 21s
Test and Coverage / Test (push) Successful in 21s
Release / Semantic release (push) Failing after 45s
Release / Build and push RPM (push) Skipped
Test and Coverage / Coverage (push) Failing after 47s
feat: semantic release workflow
2026-07-27 11:03:54 +02:00

76 lines
2.3 KiB
YAML

name: Release
on:
push:
branches:
- main
env:
RUST_BACKTRACE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Semantic release
runs-on: ubuntu-latest
outputs:
# "true" only when semantic-release actually published a release.
released: ${{ steps.semantic_release.outputs.released }}
steps:
# Check out with the bot token so semantic-release can push the version
# bump and tag past branch protection (the default token cannot).
- uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.MX_GITEA_BOT_TOKEN }}
- uses: https://github.com/dtolnay/rust-toolchain@stable
- uses: https://github.com/Swatinem/rust-cache@v2
- name: Install cargo-edit
uses: https://github.com/taiki-e/install-action@v2
with:
tool: cargo-edit
- name: Semantic release
id: semantic_release
env:
# Used by the curl step in .releaserc.json to create the Gitea release.
GITEA_URL: https://gitea.psi.ch
GITEA_REPO: ${{ github.repository }}
MX_GITEA_BOT_TOKEN: ${{ secrets.MX_GITEA_BOT_TOKEN }}
run: |
npx --yes \
-p semantic-release@25 \
-p @semantic-release/exec \
-p @semantic-release/git \
semantic-release
build-rpm:
name: Build and push RPM
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.released == 'true'
steps:
- uses: actions/checkout@v6
- uses: https://github.com/dtolnay/rust-toolchain@stable
- uses: https://github.com/Swatinem/rust-cache@v2
- name: Build RPM
run: |
# Pick up the version bump semantic-release just committed.
git pull
cargo build --release
strip -s target/release/aarel
cargo install cargo-generate-rpm
cargo generate-rpm
- name: Push to Gitea RPM registry
run: |
for pkg in target/generate-rpm/*.rpm; do
curl -f -X PUT \
--user "${{ secrets.PIP_REPOSITORY_API_TOKEN }}" \
--upload-file "$pkg" \
"https://gitea.psi.ch/api/packages/${{ github.repository_owner }}/rpm/upload"
done