Skip to content

QuickView v2.1.0 - Total Control #7

QuickView v2.1.0 - Total Control

QuickView v2.1.0 - Total Control #7

Workflow file for this run

name: Update Version JSON
on:
release:
types: [published]
permissions:
contents: write
jobs:
deploy-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate version.json with Changelog
env:
TAG_NAME: ${{ github.event.release.tag_name }}
DOWNLOAD_URL: https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/QuickView_${{ github.event.release.tag_name }}.zip
RELEASE_BODY: ${{ github.event.release.body }}
run: |
VERSION=${TAG_NAME#v}
DATE=$(date +'%Y-%m-%d')
mkdir -p public
jq -n \
--arg v "$VERSION" \
--arg u "$DOWNLOAD_URL" \
--arg d "$DATE" \
--arg c "$RELEASE_BODY" \
'{version: $v, url: $u, date: $d, changelog: $c}' \
> public/version.json
echo "=== Generated JSON Content ==="
cat public/version.json
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
force_orphan: true
keep_files: false
publish_branch: gh-pages
commit_message: "Auto-update version.json to ${{ github.event.release.tag_name }}"