Files
aare_launcher/.gitea/workflows/release.yaml
T
perl_d 541ba356d6
Check and Lint / Rustfmt (pull_request) Successful in 15s
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 19s
Check and Lint / Build RPM (pull_request) Successful in 27s
Test and Coverage / Coverage (pull_request) Successful in 39s
Check and Lint / Rustfmt (push) Successful in 15s
Check and Lint / Check (push) Successful in 27s
Check and Lint / Clippy (push) Successful in 25s
Test and Coverage / Test (push) Successful in 20s
Release / Semantic release (push) Successful in 47s
Test and Coverage / Coverage (push) Successful in 44s
Check and Lint / Build RPM (push) Successful in 1m23s
Release / Build and push RPM (push) Successful in 1m18s
fix: corrrect location for rpm
2026-08-12 11:15:01 +02:00

80 lines
2.6 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 }} # set in .releaserc.json
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
with:
targets: x86_64-unknown-linux-musl
- uses: https://github.com/Swatinem/rust-cache@v2
- name: Install musl toolchain
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Build RPM
run: |
# Pick up the version bump semantic-release just committed.
git pull
cargo build --release --target x86_64-unknown-linux-musl
strip -s target/x86_64-unknown-linux-musl/release/aarel
cargo install cargo-generate-rpm
cargo generate-rpm --target x86_64-unknown-linux-musl
- name: Push to Gitea RPM registry
run: |
for pkg in target/x86_64-unknown-linux-musl/generate-rpm/*.rpm; do
curl -f -X PUT \
--user "${{ secrets.MX_GITEA_BOT_TOKEN }}" \
--upload-file "$pkg" \
"https://gitea.psi.ch/api/packages/${{ github.repository_owner }}/rpm/upload"
done