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
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