From 4ce3046c5bb53be240ac967e411796f389ac2f5e Mon Sep 17 00:00:00 2001 From: Makrennel <70352774+Makrennel@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:20:33 +0100 Subject: [PATCH] Make build action push a signed repository xbps can use directly (#64) --- .../{build.yml => build-x86_64-glibc.yml} | 41 ++++++++++++++++--- 1 file changed, 36 insertions(+), 5 deletions(-) rename .github/workflows/{build.yml => build-x86_64-glibc.yml} (77%) diff --git a/.github/workflows/build.yml b/.github/workflows/build-x86_64-glibc.yml similarity index 77% rename from .github/workflows/build.yml rename to .github/workflows/build-x86_64-glibc.yml index bbfa3d9..5cc0007 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-x86_64-glibc.yml @@ -1,9 +1,10 @@ -name: "Build Hyprland" +name: "Build Hyprland x86_64 Glibc" on: push: branches: - master + workflow_dispatch: jobs: build: @@ -40,7 +41,7 @@ jobs: sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf xbps-install -Syu xbps xbps-install -Syu - xbps-install -y tar + xbps-install -y tar curl - name: Make void pkgs directory run: | @@ -135,6 +136,18 @@ jobs: /hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprpaper ) + - name: Retrieve private key + run: | + curl -H 'Authorization: token ${{ secrets.PEM_PAT }}' \ + -H 'Accept: application/vnd.github.v3.raw' \ + -O -L https://api.github.com/repos/Makrennel/hyprland-void-private-pem/contents/private.pem + + - name: Sign repository + run: | + export XBPS_PASSPHRASE=${{ secrets.PRIVATE_PEM_PASSPHRASE }} + xbps-rindex --privkey ./private.pem --sign --signedby "hyprland-void-github-action" ~/hostdir/binpkgs + xbps-rindex --privkey ./private.pem --sign-pkg ~/hostdir/binpkgs/*.xbps + - name: Compress Packages run: | cd ~/hostdir/binpkgs @@ -144,7 +157,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: hyprland-void - path: ~/hostdir/binpkgs + path: ~/hostdir/binpkgs/hyprland.tar.gz publish: name: Pack and Publish @@ -155,7 +168,7 @@ jobs: uses: actions/download-artifact@v4 with: name: hyprland-void - path: ./ + path: ~/ - name: Get current date run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV @@ -176,6 +189,24 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./hyprland.tar.gz + asset_path: /home/runner/hyprland.tar.gz asset_name: hyprland-${{ env.CURRENT_DATE }}.tar.gz asset_content_type: application/gzip + + - name: Checkout hyprland-void + uses: actions/checkout@v4 + + - name: Remove old repository branch + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git push origin -d repository-x86_64-glibc + + - name: Create new repository branch + run: | + git switch --orphan repository + tar -xvf ~/hyprland.tar.gz -C ./ + git add . + git commit -m "Upload latest packages to repository" + git push origin repository-x86_64-glibc +