Skip to content

Commit

Permalink
Make build action push a signed repository xbps can use directly (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Makrennel authored Jun 13, 2024
1 parent 65a98f3 commit 4ce3046
Showing 1 changed file with 36 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: "Build Hyprland"
name: "Build Hyprland x86_64 Glibc"

on:
push:
branches:
- master
workflow_dispatch:

jobs:
build:
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 4ce3046

Please sign in to comment.