Release version 1.3.2.18 #3
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: Add HotFix Metadata | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| get-version: | |
| if: startsWith(github.head_ref, 'hotfix/') | |
| uses: ./.github/workflows/step-version.yml | |
| update-metadata: | |
| if: github.event.action == 'opened' | |
| needs: [get-version] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - name: Increment Version | |
| id: increment_version | |
| run: | | |
| echo "patch_version=$(($(cat semver.json | jq -r '.patch')+1))" > $GITHUB_OUTPUT | |
| - name: Store New Version | |
| uses: Afterlife-Guide/SemVer.Action@9dc4921011b4c29d63259b6bbd6d7322410e2e91 | |
| with: | |
| path: semver.json | |
| major-version: ${{ needs.get-version.outputs.major }} | |
| minor-version: ${{ needs.get-version.outputs.minor }} | |
| patch-version: ${{ steps.increment_version.outputs.patch_version }} | |
| build-version: ${{ github.run_number }} | |
| - name: Update changelog | |
| uses: baynezy/ChangeLogger.Action@e9ba913995eaeeb49b0f9e21abcb2e98937ffb9c | |
| with: | |
| tag: ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }} | |
| - name: Update docker image tag version in action.yml | |
| run: | | |
| sed -i "s/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:.*/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}'/" action.yml | |
| - name: Commit Changes | |
| run: | | |
| git config --global user.name "GitHub Action Bot" | |
| git config --global user.email "no-reply@after-life.co" | |
| git add CHANGELOG.md semver.json action.yml | |
| git commit --message "Bump Version to ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}" | |
| - name: Push Version | |
| env: | |
| HEAD_REF: ${{ github.head_ref }} | |
| run: git push origin "$HEAD_REF" |