Update Repository #18
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 Repository | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Dependencies | |
| run: | | |
| brew install jq | |
| - name: Update app-repo.json | |
| run: | | |
| TAG="${{ github.event.release.tag_name }}" | |
| DATE="${{ github.event.release.published_at }}" | |
| VERSION="${TAG#v}" | |
| DOWNLOAD_URL="https://github.com/${{ github.repository }}/releases/download/${TAG}/Feather.ipa" | |
| jq \ | |
| --arg version "$VERSION" \ | |
| --arg date "$DATE" \ | |
| --arg url "$DOWNLOAD_URL" \ | |
| ' | |
| .apps[0].version = $version | | |
| .apps[0].versionDate = $date | | |
| .apps[0].downloadURL = $url | | |
| .apps[0].versions[0].version = $version | | |
| .apps[0].versions[0].date = $date | | |
| .apps[0].versions[0].downloadURL = $url | |
| ' app-repo.json > tmp.json | |
| mv tmp.json app-repo.json | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout main | |
| git add app-repo.json | |
| git diff --cached --quiet && echo "No changes to commit" && exit 0 | |
| git commit -m "chore: update repo for ${{ github.event.release.tag_name }}" | |
| git push origin main |