diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml new file mode 100644 index 000000000..40405b7fc --- /dev/null +++ b/.github/workflows/release_tag.yml @@ -0,0 +1,20 @@ +# This workflow adds git tag to the main branch when version changes. + +name: Release Tag + +on: + push: + branches: + - main + paths: + - VERSION + +jobs: + tag_main_branch: + runs-on: ubuntu-latest + steps: + - name: Add git tag + uses: pxpm/github-tag-action@1.0.1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + tag: v0.5.0 diff --git a/tools/bump_version.sh b/tools/bump_version.sh index aad736a1f..0aed7a6cd 100755 --- a/tools/bump_version.sh +++ b/tools/bump_version.sh @@ -85,6 +85,11 @@ validate_bump_type() { exit 1 ;; esac + +# Update tag version (`v{version}`) in file $1 +update_tag_version() { + echo "Updating file $1" + sed -i "s/v[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/v${new_version}/g" $1 } SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) @@ -124,6 +129,10 @@ for workflow in $WORKFLOWS; do update_image_versions $workflow done +# Update tag version in release_tag workflow +RELEASE_TAG_WORKFLOW=${ASTER_SRC_DIR}/.github/workflows/release_tag.yml +update_tag_version $RELEASE_TAG_WORKFLOW + # Update Docker image versions in the documentation GET_STARTED_PATH=${ASTER_SRC_DIR}/docs/src/kernel/README.md update_image_versions $GET_STARTED_PATH