Fix COPR pipeline. #79
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@v4 | |
| - name: Get dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libgtk-4-1 openssl libsqlite3-0 libsqlite3-dev libglib2.0-dev sqlite3 libgtk-4-dev meson ninja-build cargo gettext desktop-file-utils | |
| version: cargo-deps-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache Rust Artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-directories: "./target" | |
| - name: Build waytrogen | |
| run: cargo build --release | |
| - name: Upload ccompiled binary | |
| uses: actions/upload-artifact@v4 | |
| id: compiled-meson-project | |
| with: | |
| name: waytrogen_${{ github.ref_name }}_amd64 | |
| path: ./target/release/waytrogen | |
| package-deb-file: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get code | |
| uses: actions/checkout@v4 | |
| - name: Get dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libgtk-4-1 openssl libsqlite3-0 libsqlite3-dev libglib2.0-dev sqlite3 libgtk-4-dev meson ninja-build cargo gettext desktop-file-utils | |
| version: cargo-deps-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache Rust Artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-directories: "builddir/target" | |
| - name: Build waytrogen | |
| run: | | |
| TAG=${{ github.ref_name }} | |
| PACKAGE_NAME="waytrogen_${TAG}_amd64" | |
| PREFIX="debpkgs/${PACKAGE_NAME}" | |
| echo "PACKAGE_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV | |
| sed -i "s/VERSION/${TAG}/" meson.build | |
| meson setup builddir --prefix="$(realpath $PREFIX)" | |
| meson compile -C builddir | |
| meson install -C builddir | |
| mkdir -p "$PREFIX/DEBIAN" | |
| mv debpkgs/control debpkgs/postinst "$PREFIX/DEBIAN" | |
| sed -i "s/VERSION/${TAG}/" "$PREFIX/DEBIAN/control" | |
| chmod 755 "$PREFIX/DEBIAN/postinst" | |
| dpkg-deb --build "$PREFIX" | |
| - name: Upload deb package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "${{ env.PACKAGE_NAME }}.deb" | |
| path: debpkgs/*.deb | |
| get-vendored-dependencies: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get code | |
| uses: actions/checkout@v4 | |
| - name: Generate vendor tarball | |
| uses: dtolnay/rust-toolchain@stable | |
| - run: | | |
| cargo vendor vendor/ | |
| tar -czf waytrogen-${{ github.ref_name }}-vendor.tar.gz vendor | |
| - name: Upload vendored dependencies | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| 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@v4 | |
| 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@v4 | |
| with: | |
| name: waytrogen_${{ github.ref_name }}_amd64.deb | |
| - name: Get vendor file | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: waytrogen-${{ github.ref_name }}-vendor.tar.gz | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| waytrogen_${{ github.ref_name }}_amd64 | |
| waytrogen_${{ github.ref_name }}_amd64.deb | |
| waytrogen-${{ github.ref_name }}-vendor.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@v4 | |
| - 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 |