Skip to content

Commit

Permalink
Update go driver version handling (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: Andreas Braun <[email protected]>
  • Loading branch information
blink1073 and alcaeus authored Oct 7, 2024
1 parent 328f05d commit b32c15d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
10 changes: 8 additions & 2 deletions golang/pre-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ inputs:
runs:
using: composite
steps:
- name: Set up environment
shell: bash
run:
bash ${{ github.action_path }}/set-environment.sh
env:
VERSION: "${{ inputs.version }}"
- uses: mongodb-labs/drivers-github-tools/bump-version@v2
with:
version: ${{ inputs.version }}
version_bump_script: "go run ${{ github.action_path }}/bump-version.go"
commit_template: "BUMP v${VERSION}"
commit_template: "${{ env.COMMIT_TEMPLATE }}"
push_commit: ${{ inputs.push_changes }}
- uses: mongodb-labs/drivers-github-tools/tag-version@v2
with:
version: v${{ inputs.version }}
version: "${{ env.TAG_VERSION }}"
push_tag: ${{ inputs.push_changes }}
13 changes: 13 additions & 0 deletions golang/pre-publish/set-environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/bash
set -eu

COMMIT_TEMPLATE='BUMP v${VERSION}'
TAG_VERSION="v${VERSION}"

if [[ "${VERSION}" =~ ^cloud.* ]]; then
COMMIT_TEMPLATE='BUMP ${VERSION}'
TAG_VERSION="${VERSION}"
fi

echo "COMMIT_TEMPLATE=$COMMIT_TEMPLATE" >> $GITHUB_ENV
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV

0 comments on commit b32c15d

Please sign in to comment.