0
0
mirror of https://git.743378673.xyz/MeloNX/MeloNX.git synced 2025-04-24 08:25:14 +00:00
MeloNX/.gitea/workflows/updateApp.yml
2025-04-08 13:23:41 +10:00

50 lines
1.8 KiB
YAML

name: Update apps.json on new release
on:
release:
types: [published]
jobs:
update:
runs-on: debian-trixie
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get install -y jq
- name: Extract release data
id: release
run: |
echo "VERSION=${GITEA_REF_NAME}" >> $GITHUB_OUTPUT
echo "DESCRIPTION=$(echo '${GITEA_EVENT_RELEASE_BODY}' | jq -Rs .)" >> $GITHUB_OUTPUT
echo "DATE=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
IPA_URL=$(echo '${GITEA_EVENT_RELEASE_ASSETS}' | jq -r '.[0].browser_download_url')
echo "DOWNLOAD_URL=$IPA_URL" >> $GITHUB_OUTPUT
- name: Update apps.json
run: |
jq --arg version "${{ steps.release.outputs.VERSION }}" \
--arg buildVersion "1" \
--arg date "${{ steps.release.outputs.DATE }}" \
--arg localizedDescription "${{ steps.release.outputs.DESCRIPTION }}" \
--arg downloadURL "${{ steps.release.outputs.DOWNLOAD_URL }}" \
'.apps[0].versions |= [{"version": $version, "buildVersion": $buildVersion, "date": $date, "localizedDescription": $localizedDescription, "downloadURL": $downloadURL, "minOSVersion": "15.0"}]' \
apps.json > tmp.json && mv tmp.json apps.json
- name: Commit and push
run: |
git config user.name "gitea-actions"
git config user.email "gitea-actions@localhost"
git add apps.json
git commit -m "Update apps.json for release ${{ steps.release.outputs.VERSION }}"
git push
env:
GIT_AUTHOR_NAME: gitea-actions
GIT_AUTHOR_EMAIL: gitea-actions@localhost
GIT_COMMITTER_NAME: gitea-actions
GIT_COMMITTER_EMAIL: gitea-actions@localhost