Skip to content

docs(): bumping release v1.2.56 #120

docs(): bumping release v1.2.56

docs(): bumping release v1.2.56 #120

Workflow file for this run

name: 'Post Merge'
on:
push:
branches:
- master
jobs:
write-info:
runs-on: ubuntu-latest
name: 'Write Info'
outputs:
version: ${{ steps.push-file.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: 'Get Info'
run: |
echo "shortCommit=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "currentVersion=$(cat info.json | jq -r '.version')" >> $GITHUB_ENV
- name: 'Calc Next Version'
id: next-version
shell: bash
run: |
split=(${VERSION//.// })
index=$((${#split[@]}-1))
nexPatchVersion=$((${split[$index]} + 1))
echo nextVersion=${{format('{0}.{1}.{2}', '${split[0]/\//}', '${split[1]/\//}', '$nexPatchVersion')}} >> $GITHUB_ENV
env:
VERSION: ${{ env.currentVersion }}
- name: 'Update Short Commit'
uses: jossef/[email protected]
with:
file: info.json
field: shortCommit
value: ${{ env.shortCommit }}
- name: 'Update New Version'
uses: jossef/[email protected]
with:
file: info.json
field: version
value: ${{ env.nextVersion }}
- name: 'Get Data from Github'
run: |
echo GITHUB_EMAIL=$(git --no-pager show -s --format=\'%ae\') >> $GITHUB_ENV
echo GITHUB_COMMIT_MESSAGE=$(git log -1 --pretty=%B) >> $GITHUB_ENV
- name: 'Setup GIT'
run: |
echo "Setting email to: ${GITHUB_EMAIL}"
echo "Setting user to: ${GITHUB_ACTOR}"
echo "Commit message: $GITHUB_COMMIT_MESSAGE"
git config user.email "$GITHUB_EMAIL"
git config user.name "$GITHUB_ACTOR"
- name: 'Push Info File'
id: push-file
if: contains(env.GITHUB_COMMIT_MESSAGE, 'bumping release v') == false
run: |
git add -A
git commit -m "docs(): bumping release v$VERSION"
git push "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY"
echo "version=$VERSION" >> $GITHUB_OUTPUT
env:
VERSION: ${{ env.nextVersion }}
GITHUB_TOKEN: ${{ secrets.VERSION_BUMP}}
echo-commit-message:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Echo Version from info.json'
run: echo "version=$(jq -r '.version' info.json)" >> $GITHUB_ENV
- name: 'Echo commit message from github.event.head_commit.message'
if: contains(github.event.head_commit.message, 'bumping release v')
run: |
echo "commit_message: ${{ github.event.head_commit.message }}"
echo "version: ${VERSION}"
env:
VERSION: ${{ env.version }}