Skip to content

Commit c9c4115

Browse files
committed
Update go driver version handling
1 parent 328f05d commit c9c4115

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

golang/pre-publish/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ inputs:
1111
runs:
1212
using: composite
1313
steps:
14+
- name: Set up environment
15+
shell: bash
16+
run:
17+
VERSION="${{ inputs.version }}" bash ${{ github.action_path }}/set-environment.sh
1418
- uses: mongodb-labs/drivers-github-tools/bump-version@v2
1519
with:
1620
version: ${{ inputs.version }}
1721
version_bump_script: "go run ${{ github.action_path }}/bump-version.go"
18-
commit_template: "BUMP v${VERSION}"
22+
commit_template: "${{ env.COMMIT_TEMPLATE }}"
1923
push_commit: ${{ inputs.push_changes }}
2024
- uses: mongodb-labs/drivers-github-tools/tag-version@v2
2125
with:
22-
version: v${{ inputs.version }}
26+
version: "${{ env.TAG_VERSION }}"
2327
push_tag: ${{ inputs.push_changes }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /bin/bash
2+
set -eu
3+
4+
COMMIT_TEMPLATE='BUMP v${VERSION}'
5+
TAG_VERSION="v${VERSION}"
6+
7+
if [[ "${VERSION}" =~ cloud.* ]]; then
8+
COMMIT_TEMPLATE='BUMP ${VERSION}'
9+
TAG_VERSION="${VERSION}"
10+
fi
11+
12+
echo "COMMIT_TEMPLATE=$COMMIT_TEMPLATE" >> $GITHUB_OUTPUT
13+
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)