From df679c4377cc2562077f0bae85c4a39e12614d5e Mon Sep 17 00:00:00 2001 From: alvinlollo Date: Mon, 14 Sep 2026 17:21:38 +1000 Subject: [PATCH] Fix gitea workflows --- .gitea/workflows/build-iso.yaml | 38 ++++++++++++---- .gitea/workflows/check-packages.yml | 68 ++++++++++++----------------- .gitea/workflows/syntax-check.yaml | 7 ++- 3 files changed, 61 insertions(+), 52 deletions(-) diff --git a/.gitea/workflows/build-iso.yaml b/.gitea/workflows/build-iso.yaml index c66cce1..6442a6d 100644 --- a/.gitea/workflows/build-iso.yaml +++ b/.gitea/workflows/build-iso.yaml @@ -17,12 +17,12 @@ jobs: - name: Install archiso and dependencies run: | - sudo pacman -Syu --noconfirm archiso + pacman -Syu --noconfirm archiso jq - name: Build Arch ISO run: | # Replace 'releng' with your custom profile directory if needed - sudo mkarchiso -v -w work -o out/ releng + mkarchiso -v -w work -o out/ releng - name: Generate Unique Dynamic Tag id: tag @@ -46,13 +46,33 @@ jobs: echo "release_name=Arch Linux ISO (${BASE_DATE} Rev ${REVISION})" >> $GITHUB_OUTPUT - name: Create Release and Upload ISO - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ steps.tag.outputs.tag_name }} - name: ${{ steps.tag.outputs.release_name }} - files: out/*.iso env: - GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + SERVER_URL: ${{ github.server_url }} + REPOSITORY: ${{ github.repository }} + TAG_NAME: ${{ steps.tag.outputs.tag_name }} + RELEASE_NAME: ${{ steps.tag.outputs.release_name }} + run: | + # Create the release via Gitea API + RELEASE_ID=$(curl -s -X POST \ + -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + "$SERVER_URL/api/v1/repos/$REPOSITORY/releases" \ + -d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$RELEASE_NAME\"}" \ + | jq -r '.id') + + echo "Created release ID: $RELEASE_ID" + + # Upload each ISO as a release asset + for iso in out/*.iso; do + echo "Uploading $iso..." + curl -s -X POST \ + -H "Authorization: token $GITEA_TOKEN" \ + -F "attachment=@$iso" \ + "$SERVER_URL/api/v1/repos/$REPOSITORY/releases/$RELEASE_ID/assets" + done + + echo "Release $TAG_NAME created and ISOs uploaded." - name: Keep only latest 3 releases env: @@ -71,4 +91,4 @@ jobs: curl -s -X DELETE -H "Authorization: token $GITEA_TOKEN" \ "$SERVER_URL/api/v1/repos/$REPOSITORY/releases/$id" fi - done + done \ No newline at end of file diff --git a/.gitea/workflows/check-packages.yml b/.gitea/workflows/check-packages.yml index d2e25c0..10205be 100644 --- a/.gitea/workflows/check-packages.yml +++ b/.gitea/workflows/check-packages.yml @@ -12,30 +12,31 @@ on: jobs: check-packages: runs-on: archlinux - container: - image: archlinux:latest steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Install prerequisites run: | pacman -Syu --noconfirm --needed pacman pacman-contrib curl gnupg - name: Set up official repos (extra, multilib) run: | - cat > /etc/pacman.conf <<'EOF' - [options] - Architecture = auto - SigLevel = Required DatabaseOptional - LocalFileSigLevel = Optional - - [core] - Include = /etc/pacman.d/mirrorlist - - [extra] - Include = /etc/pacman.d/mirrorlist - - [multilib] - Include = /etc/pacman.d/mirrorlist - EOF + printf '%s\n' \ + '[options]' \ + 'Architecture = auto' \ + 'SigLevel = Required DatabaseOptional' \ + 'LocalFileSigLevel = Optional' \ + '' \ + '[core]' \ + 'Include = /etc/pacman.d/mirrorlist' \ + '' \ + '[extra]' \ + 'Include = /etc/pacman.d/mirrorlist' \ + '' \ + '[multilib]' \ + 'Include = /etc/pacman.d/mirrorlist' \ + > /etc/pacman.conf # Generate a basic mirrorlist curl -fsSL "https://archlinux.org/mirrorlist/all/status/" \ @@ -51,17 +52,13 @@ jobs: pacman -U --noconfirm /tmp/cachyos-keyring.pkg.tar.zst || true # Add CachyOS mirrorlist - cat > /etc/pacman.d/cachyos-mirrorlist <<'MIRROR' - Server = https://mirror.cachyos.org/$repo/$arch - MIRROR + printf '%s\n' \ + 'Server = https://mirror.cachyos.org/$repo/$arch' \ + > /etc/pacman.d/cachyos-mirrorlist # Add CachyOS repo to pacman.conf - cat >> /etc/pacman.conf <<'EOF' - - [cachyos] - SigLevel = Optional TrustAll - Include = /etc/pacman.d/cachyos-mirrorlist - EOF + printf '\n[cachyos]\nSigLevel = Optional TrustAll\nInclude = /etc/pacman.d/cachyos-mirrorlist\n' \ + >> /etc/pacman.conf pacman -Syu --noconfirm @@ -72,23 +69,16 @@ jobs: pacman-key --lsign-key FBA220DFC880C036 || true # Add chaotic-aur mirrorlist - cat > /etc/pacman.d/chaotic-mirrorlist <<'MIRROR' - Server = https://chaotic.archlinux.org/$repo/$arch - MIRROR + printf '%s\n' \ + 'Server = https://chaotic.archlinux.org/$repo/$arch' \ + > /etc/pacman.d/chaotic-mirrorlist # Add chaotic-aur repo to pacman.conf - cat >> /etc/pacman.conf <<'EOF' - - [chaotic-aur] - SigLevel = Optional TrustAll - Include = /etc/pacman.d/chaotic-mirrorlist - EOF + printf '\n[chaotic-aur]\nSigLevel = Optional TrustAll\nInclude = /etc/pacman.d/chaotic-mirrorlist\n' \ + >> /etc/pacman.conf pacman -Syu --noconfirm - - name: Checkout repo - uses: actions/checkout@v4 - - name: Check all packages run: | echo "═══════════════════════════════════════════════════════════════" @@ -140,4 +130,4 @@ jobs: else echo "" echo "✅ All packages verified successfully!" - fi + fi \ No newline at end of file diff --git a/.gitea/workflows/syntax-check.yaml b/.gitea/workflows/syntax-check.yaml index 1d7d0d0..ec5ac11 100644 --- a/.gitea/workflows/syntax-check.yaml +++ b/.gitea/workflows/syntax-check.yaml @@ -7,16 +7,15 @@ on: jobs: syntax-check: - runs-on: ubuntu-latest + runs-on: archlinux steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install linting tools run: | - sudo apt-get update - sudo apt-get install -y shellcheck - pip install --break-system-packages yamllint + set -e + pacman -Syu --noconfirm --needed shellcheck python-yamllint - name: Lint shell scripts with ShellCheck run: |