mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-26 23:26:47 +01:00
60 lines
2.0 KiB
YAML
60 lines
2.0 KiB
YAML
name: Update OS List for RPi Imager
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_run:
|
|
workflows: ["release.yaml"]
|
|
types:
|
|
- completed
|
|
|
|
jobs:
|
|
update-os-list:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get release information
|
|
id: release
|
|
run: |
|
|
# Fetch latest release info
|
|
RESPONSE=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest")
|
|
VERSION=$(echo "$RESPONSE" | jq -r '.tag_name')
|
|
RELEASE_DATE=$(echo "$RESPONSE" | jq -r '.published_at' | cut -d'T' -f1)
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "release_date=$RELEASE_DATE" >> $GITHUB_OUTPUT
|
|
echo "Found release: $VERSION (published: $RELEASE_DATE)"
|
|
|
|
- name: Download release assets and generate OS list
|
|
env:
|
|
VERSION: ${{ steps.release.outputs.version }}
|
|
RELEASE_DATE: ${{ steps.release.outputs.release_date }}
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
cd installers
|
|
echo "Downloading release assets for $VERSION..."
|
|
gh release download "$VERSION" \
|
|
--pattern "raspap-trixie-armhf-lite-*.img.zip" \
|
|
--pattern "raspap-trixie-arm64-lite-*.img.zip"
|
|
chmod +x ./generate_os_list.sh
|
|
./generate_os_list.sh
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add installers/os-sublist-raspap.json
|
|
if git diff --staged --quiet; then
|
|
echo "No changes to commit"
|
|
else
|
|
git commit -m "Update OS list for RPi Imager (${{ steps.release.outputs.version }})"
|
|
git push
|
|
fi
|
|
|