2022-09-04 12:11:57 +02:00
|
|
|
name: Update dynamic files
|
|
|
|
|
|
|
|
# When pushing to the master branch
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
2024-03-17 16:56:05 +01:00
|
|
|
# Cancel running actions if new commits are added
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-09-04 12:11:57 +02:00
|
|
|
|
|
|
|
# parameters
|
|
|
|
env:
|
|
|
|
TAG: latest
|
|
|
|
SHIELDS: shields.json
|
|
|
|
|
2022-10-23 11:55:01 +02:00
|
|
|
permissions:
|
|
|
|
contents: write # need to update tag and release
|
2022-09-04 12:11:57 +02:00
|
|
|
|
|
|
|
# Workflow in ubuntu
|
|
|
|
jobs:
|
|
|
|
update:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Get the repository files
|
2023-10-06 16:59:07 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-09-04 12:11:57 +02:00
|
|
|
|
|
|
|
- name: Create ${{ env.SHIELDS }} file
|
|
|
|
run: |
|
|
|
|
cat <<EOF | tee ${{ env.SHIELDS }}
|
|
|
|
{
|
|
|
|
"version": "v$(sed -ne "s/ *versionName \+['\"]\([^'\"]*\)['\"]/\1/p" app/build.gradle)"
|
|
|
|
}
|
|
|
|
EOF
|
2022-10-05 23:26:46 +02:00
|
|
|
|
2022-09-04 12:11:57 +02:00
|
|
|
- name: Update ${{ env.TAG }} tag to current commit
|
|
|
|
# equivalent to EndBug/latest-tag@latest but simpler
|
|
|
|
run: |
|
|
|
|
git tag --force ${{ env.TAG }}
|
|
|
|
git push --force origin tag ${{ env.TAG }}
|
2022-10-05 23:26:46 +02:00
|
|
|
|
|
|
|
- name: Upload ${{ env.SHIELDS }} to ${{ env.TAG }} release
|
|
|
|
# equivalent to softprops/action-gh-release@v1 but using official cli
|
|
|
|
run: |
|
|
|
|
gh release upload ${{ env.TAG }} ${{ env.SHIELDS }} --clobber
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|