v1.0.6 #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update JSON File | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| update-json: | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Extract Module Info | |
| id: info | |
| run: | | |
| VERSION=$(grep '^version=' module/module.prop | cut -d= -f2) | |
| VERSION_CODE=$(grep '^versionCode=' module/module.prop | cut -d= -f2) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "code=$VERSION_CODE" >> $GITHUB_OUTPUT | |
| - name: Generate update.json | |
| run: | | |
| cat <<EOF > update.json | |
| { | |
| "version": "${{ steps.info.outputs.version }}", | |
| "versionCode": ${{ steps.info.outputs.code }}, | |
| "zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/SPenCursorOverlay-${{ steps.info.outputs.version }}.zip", | |
| "changelog": "https://raw.githubusercontent.com/${{ github.repository }}/main/CHANGELOG.md" | |
| } | |
| EOF | |
| - name: Commit and Push update.json | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add update.json | |
| git commit -m "chore: update update.json for version ${{ steps.info.outputs.version }}" || echo "No changes to commit" | |
| git push origin main |