Rework deb packaging. #131
Workflow file for this run
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: Build waytrogen | |
| on: | |
| push: | |
| tags: | |
| - "*.*.*" | |
| jobs: | |
| build-prefix-usr-binary: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get code | |
| uses: actions/checkout@v7 | |
| - name: Get dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y openssl libsqlite3-dev sqlite3 meson ninja-build desktop-file-utils rustup | |
| - name: Set up Rust toolchain | |
| run: | | |
| rustup toolchain install stable | |
| rustup default stable | |
| - name: Add rustup cargo bin to PATH | |
| run: echo "${HOME}/.cargo/bin" >> $GITHUB_PATH | |
| - name: Build waytrogen | |
| run: cargo build --release | |
| - name: Upload compiled binary | |
| uses: actions/upload-artifact@v7 | |
| id: compiled-meson-project | |
| with: | |
| if-no-files-found: error | |
| name: waytrogen_${{ github.ref_name }}_amd64 | |
| path: ./target/release/waytrogen | |
| - name: Archive Completions | |
| run: | | |
| tar -czf waytrogen-${{ github.ref_name }}-shell-completions.tar.gz ./target/completions | |
| - name: Upload completions | |
| uses: actions/upload-artifact@v7 | |
| id: shell-completions | |
| with: | |
| if-no-files-found: error | |
| name: waytrogen-${{ github.ref_name }}-shell-completions.tar.gz | |
| path: waytrogen-${{ github.ref_name }}-shell-completions.tar.gz | |
| package-deb-file: | |
| needs: [ get-vendored-dependencies ] | |
| runs-on: ubuntu-26.04 | |
| steps: | |
| - name: Get code | |
| uses: actions/checkout@v7 | |
| - name: Enable Vendor Build | |
| run: | | |
| mv .cargo/config.toml.disabled .cargo/config.toml | |
| - name: Get vendored dependencies | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: waytrogen-${{ github.ref_name }}-vendor.tar.gz | |
| - name: Extract vendored dependencies | |
| run: | | |
| tar -xzf waytrogen-${{ github.ref_name }}-vendor.tar.gz | |
| - uses: jtdor/build-deb-action@v1 | |
| env: | |
| DEB_BUILD_OPTIONS: noautodbgsym | |
| with: | |
| buildpackage-opts: --build=binary --no-sign | |
| before-build-hook: ls -la vendor/anyhow && realpath vendor/anyhow/Cargo.toml.orig | |
| docker-image: debian:unstable | |
| - name: Debug artifacts | |
| run: | | |
| ls debian/artifacts | |
| - name: Upload deb package | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| if-no-files-found: error | |
| name: "waytrogen_${{ github.ref_name }}-1_amd64.deb" | |
| path: "debian/artifacts/waytrogen_${{ github.ref_name }}-1_amd64.deb" | |
| get-vendored-dependencies: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get code | |
| uses: actions/checkout@v7 | |
| - name: Set up Rust toolchain | |
| run: | | |
| rustup default stable | |
| - name: Generate vendor tarball | |
| run: | | |
| cargo vendor vendor/ | |
| tar -czf waytrogen-${{ github.ref_name }}-vendor.tar.gz vendor | |
| - name: Upload vendored dependencies | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| if-no-files-found: error | |
| name: waytrogen-${{ github.ref_name }}-vendor.tar.gz | |
| path: waytrogen-${{ github.ref_name }}-vendor.tar.gz | |
| create-release: | |
| needs: [ build-prefix-usr-binary, package-deb-file, get-vendored-dependencies ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get generic build prefix usr binary | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: waytrogen_${{ github.ref_name }}_amd64 | |
| - name: Rename precompiled binary | |
| run: mv waytrogen waytrogen_${{ github.ref_name }}_amd64 | |
| - name: Get deb file | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: waytrogen_${{ github.ref_name }}-1_amd64.deb | |
| - name: Get vendor file | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: waytrogen-${{ github.ref_name }}-vendor.tar.gz | |
| - name: Get shell completions file | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: waytrogen-${{ github.ref_name }}-shell-completions.tar.gz | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| waytrogen_${{ github.ref_name }}_amd64 | |
| waytrogen_${{ github.ref_name }}-1_amd64.deb | |
| waytrogen-${{ github.ref_name }}-vendor.tar.gz | |
| waytrogen-${{ github.ref_name }}-shell-completions.tar.gz | |
| make_latest: 'true' | |
| publish-waytrogen-to-aur: | |
| needs: [ create-release ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get AUR PKGBUILD | |
| run: | | |
| git clone https://aur.archlinux.org/waytrogen.git | |
| - name: Prepare PKGBUILD | |
| run: | |
| sed -i "s/pkgver=.*/pkgver=${{ github.ref_name }}/" waytrogen/PKGBUILD | |
| - name: Publish to AUR | |
| uses: KSXGitHub/github-actions-deploy-aur@v4.1.3 | |
| with: | |
| pkgname: waytrogen | |
| pkgbuild: ./waytrogen/PKGBUILD | |
| commit_username: ${{ secrets.AUR_USERNAME }} | |
| commit_email: ${{ secrets.AUR_EMAIL }} | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: Update to ${{ github.ref_name }} | |
| publish-waytrogen-bin-to-aur: | |
| permissions: | |
| contents: write | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get AUR PKGBUILD | |
| run: | | |
| git clone https://aur.archlinux.org/waytrogen-bin.git | |
| - name: Prepare PKGBUILD | |
| run: | |
| sed -i "s/pkgver=.*/pkgver=${{ github.ref_name }}/" waytrogen-bin/PKGBUILD | |
| - name: Publish to AUR | |
| uses: KSXGitHub/github-actions-deploy-aur@v4.1.3 | |
| with: | |
| pkgname: waytrogen-bin | |
| pkgbuild: ./waytrogen-bin/PKGBUILD | |
| commit_username: ${{ secrets.AUR_USERNAME }} | |
| commit_email: ${{ secrets.AUR_EMAIL }} | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: Update to ${{ github.ref_name }} | |
| publish-waytrogen-to-copr: | |
| needs: [ create-release ] | |
| container: fedora:latest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get code | |
| uses: actions/checkout@v7 | |
| - name: Install API token for copr-cli | |
| env: | |
| API_TOKEN_CONTENT: ${{ secrets.COPR_CLI_CONFIG }} | |
| run: | | |
| mkdir -p "$HOME/.config" | |
| echo "$API_TOKEN_CONTENT" > "$HOME/.config/copr" | |
| - name: Install build tools | |
| run: | | |
| dnf -y install @development-tools @rpm-development-tools | |
| dnf -y install copr-cli | |
| - name: Get Source Files | |
| run: | | |
| spectool -g -R waytrogen.spec | |
| - name: Build SRPM | |
| run: | | |
| rpmbuild -bs waytrogen.spec | |
| - name: Upload SRPM to COPR | |
| run: | | |
| copr-cli build waytrogen ~/rpmbuild/SRPMS/waytrogen-*.src.rpm |