Skip to content

On Release

On Release #30

Workflow file for this run

name: On Release
on:
release:
branches: [ "main" ]
types: [published, prereleased]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.TOKEN_FOR_ONCHANGE }}
- name: Update version.txt
run: |
echo "Version= ${GITHUB_REF_NAME}" > caper/version.txt
echo "Creator= ${GITHUB_ACTOR}" >> caper/version.txt
NOW=`date`
echo "Date= ${NOW}" >> caper/version.txt
COMMIT_ID=`git rev-parse HEAD`
echo "CommitID=${COMMIT_ID}" >> caper/version.txt
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto-Update version.txt on release
push_options: '--force'
branch: main
- name: move tag on version.txt to our updated one
run: |
git tag -f ${GITHUB_REF_NAME}
git push -f --tags