fix: push RPM to PSI gitea #10
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| release: | |
| uses: semantic-release-action/rust/.github/workflows/release-binary.yml@v5 | |
| permissions: | |
| contents: write | |
| packages: write | |
| with: | |
| toolchain: stable | |
| targets: | | |
| aarch64-apple-darwin | |
| x86_64-unknown-linux-gnu | |
| secrets: | |
| cargo-registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| build-rpm: | |
| name: Build and push RPM | |
| runs-on: "ubuntu-latest" | |
| needs: release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build RPM | |
| run: | | |
| cargo build --release | |
| strip -s target/release/bec_log_ingestor | |
| cargo install cargo-generate-rpm | |
| cargo generate-rpm | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: RPM artifact | |
| path: target/generate-rpm/*.rpm | |
| - name: Push to Gitea registry | |
| run: | | |
| for pkg in target/generate-rpm/*.rpm; do | |
| curl -X PUT \ | |
| --user "${{ secrets.GITEA_REGISTRY_TOKEN }}" \ | |
| --upload-file "$pkg" \ | |
| "https://gitea.psi.ch/api/packages/bec/rpm/upload" | |
| done |