Tag Version #77
This file contains 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: Tag Version | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseType: | |
description: "Semver Release Type (major,minor,patch)" | |
required: true | |
jobs: | |
tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ZORGBORT_TOKEN }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Validate releaseType | |
run: npx in-string-list ${{ github.event.inputs.releaseType }} major,minor,patch | |
- name: Setup Git | |
run: | | |
git config user.name Zorgbort | |
git config user.email [email protected] | |
- name: Increment Frontend Version | |
working-directory: ./packages/frontend | |
run: npx versionup --level ${{ github.event.inputs.releaseType }} | |
- name: Increment LTI Dashboard Version | |
working-directory: ./packages/lti-dashboard | |
run: npx versionup --level ${{ github.event.inputs.releaseType }} | |
- run: | | |
NEW_TAG=`node -p "require('./packages/frontend/package.json').version"` | |
echo ${NEW_TAG} | |
echo "new_tag=${NEW_TAG}" >> $GITHUB_ENV | |
- name: Tag Version | |
run: | | |
git commit -a -m "${{env.new_tag}}" | |
git tag v${{env.new_tag}} -m "Tagging the v${{env.new_tag}} ${{ github.event.inputs.releaseType }} release" | |
- name: Push Changes | |
run: git push --follow-tags | |
- uses: act10ns/slack@v2 | |
if: failure() | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ILIOS_DEPLOYMENT_WEBHOOK_URL }} | |
with: | |
status: ${{ job.status }} | |
message: Version Tagging Failed {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }} |