0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00
UrlChecker/.github/workflows/latest.yml
2024-08-28 18:51:07 +02:00

48 lines
1.2 KiB
YAML

name: Update dynamic files
# When pushing to the master branch
on:
push:
branches:
- master
# Cancel running actions if new commits are added
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# parameters
env:
TAG: latest
SHIELDS: shields.json
permissions:
contents: write # need to update tag and release
# Workflow in ubuntu
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Get the repository files
uses: actions/checkout@v4
- name: Create ${{ env.SHIELDS }} file
run: |
cat <<EOF | tee ${{ env.SHIELDS }}
{
"version": "v$(sed -ne "s/ *versionName \+['\"]\([^'\"]*\)['\"]/\1/p" app/build.gradle)"
}
EOF
- name: Update ${{ env.TAG }} tag to current commit
run: |
git tag --force ${{ env.TAG }}
git push --force origin tag ${{ env.TAG }}
- name: Upload ${{ env.SHIELDS }} to ${{ env.TAG }} release
run: |
gh release upload ${{ env.TAG }} ${{ env.SHIELDS }} --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}