Fix gitea workflows

This commit is contained in:
alvinlollo
2026-09-15 15:37:35 +10:00
committed by alvinlollo
parent 89e98b1fe3
commit df679c4377
3 changed files with 61 additions and 52 deletions
+29 -9
View File
@@ -17,12 +17,12 @@ jobs:
- name: Install archiso and dependencies - name: Install archiso and dependencies
run: | run: |
sudo pacman -Syu --noconfirm archiso pacman -Syu --noconfirm archiso jq
- name: Build Arch ISO - name: Build Arch ISO
run: | run: |
# Replace 'releng' with your custom profile directory if needed # 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 - name: Generate Unique Dynamic Tag
id: tag id: tag
@@ -46,13 +46,33 @@ jobs:
echo "release_name=Arch Linux ISO (${BASE_DATE} Rev ${REVISION})" >> $GITHUB_OUTPUT echo "release_name=Arch Linux ISO (${BASE_DATE} Rev ${REVISION})" >> $GITHUB_OUTPUT
- name: Create Release and Upload ISO - 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: 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 - name: Keep only latest 3 releases
env: env:
@@ -71,4 +91,4 @@ jobs:
curl -s -X DELETE -H "Authorization: token $GITEA_TOKEN" \ curl -s -X DELETE -H "Authorization: token $GITEA_TOKEN" \
"$SERVER_URL/api/v1/repos/$REPOSITORY/releases/$id" "$SERVER_URL/api/v1/repos/$REPOSITORY/releases/$id"
fi fi
done done
+29 -39
View File
@@ -12,30 +12,31 @@ on:
jobs: jobs:
check-packages: check-packages:
runs-on: archlinux runs-on: archlinux
container:
image: archlinux:latest
steps: steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install prerequisites - name: Install prerequisites
run: | run: |
pacman -Syu --noconfirm --needed pacman pacman-contrib curl gnupg pacman -Syu --noconfirm --needed pacman pacman-contrib curl gnupg
- name: Set up official repos (extra, multilib) - name: Set up official repos (extra, multilib)
run: | run: |
cat > /etc/pacman.conf <<'EOF' printf '%s\n' \
[options] '[options]' \
Architecture = auto 'Architecture = auto' \
SigLevel = Required DatabaseOptional 'SigLevel = Required DatabaseOptional' \
LocalFileSigLevel = Optional 'LocalFileSigLevel = Optional' \
'' \
[core] '[core]' \
Include = /etc/pacman.d/mirrorlist 'Include = /etc/pacman.d/mirrorlist' \
'' \
[extra] '[extra]' \
Include = /etc/pacman.d/mirrorlist 'Include = /etc/pacman.d/mirrorlist' \
'' \
[multilib] '[multilib]' \
Include = /etc/pacman.d/mirrorlist 'Include = /etc/pacman.d/mirrorlist' \
EOF > /etc/pacman.conf
# Generate a basic mirrorlist # Generate a basic mirrorlist
curl -fsSL "https://archlinux.org/mirrorlist/all/status/" \ curl -fsSL "https://archlinux.org/mirrorlist/all/status/" \
@@ -51,17 +52,13 @@ jobs:
pacman -U --noconfirm /tmp/cachyos-keyring.pkg.tar.zst || true pacman -U --noconfirm /tmp/cachyos-keyring.pkg.tar.zst || true
# Add CachyOS mirrorlist # Add CachyOS mirrorlist
cat > /etc/pacman.d/cachyos-mirrorlist <<'MIRROR' printf '%s\n' \
Server = https://mirror.cachyos.org/$repo/$arch 'Server = https://mirror.cachyos.org/$repo/$arch' \
MIRROR > /etc/pacman.d/cachyos-mirrorlist
# Add CachyOS repo to pacman.conf # Add CachyOS repo to pacman.conf
cat >> /etc/pacman.conf <<'EOF' printf '\n[cachyos]\nSigLevel = Optional TrustAll\nInclude = /etc/pacman.d/cachyos-mirrorlist\n' \
>> /etc/pacman.conf
[cachyos]
SigLevel = Optional TrustAll
Include = /etc/pacman.d/cachyos-mirrorlist
EOF
pacman -Syu --noconfirm pacman -Syu --noconfirm
@@ -72,23 +69,16 @@ jobs:
pacman-key --lsign-key FBA220DFC880C036 || true pacman-key --lsign-key FBA220DFC880C036 || true
# Add chaotic-aur mirrorlist # Add chaotic-aur mirrorlist
cat > /etc/pacman.d/chaotic-mirrorlist <<'MIRROR' printf '%s\n' \
Server = https://chaotic.archlinux.org/$repo/$arch 'Server = https://chaotic.archlinux.org/$repo/$arch' \
MIRROR > /etc/pacman.d/chaotic-mirrorlist
# Add chaotic-aur repo to pacman.conf # Add chaotic-aur repo to pacman.conf
cat >> /etc/pacman.conf <<'EOF' printf '\n[chaotic-aur]\nSigLevel = Optional TrustAll\nInclude = /etc/pacman.d/chaotic-mirrorlist\n' \
>> /etc/pacman.conf
[chaotic-aur]
SigLevel = Optional TrustAll
Include = /etc/pacman.d/chaotic-mirrorlist
EOF
pacman -Syu --noconfirm pacman -Syu --noconfirm
- name: Checkout repo
uses: actions/checkout@v4
- name: Check all packages - name: Check all packages
run: | run: |
echo "═══════════════════════════════════════════════════════════════" echo "═══════════════════════════════════════════════════════════════"
@@ -140,4 +130,4 @@ jobs:
else else
echo "" echo ""
echo "✅ All packages verified successfully!" echo "✅ All packages verified successfully!"
fi fi
+3 -4
View File
@@ -7,16 +7,15 @@ on:
jobs: jobs:
syntax-check: syntax-check:
runs-on: ubuntu-latest runs-on: archlinux
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install linting tools - name: Install linting tools
run: | run: |
sudo apt-get update set -e
sudo apt-get install -y shellcheck pacman -Syu --noconfirm --needed shellcheck python-yamllint
pip install --break-system-packages yamllint
- name: Lint shell scripts with ShellCheck - name: Lint shell scripts with ShellCheck
run: | run: |