Skip to content

Commit b32c15d

Browse files
blink1073alcaeus
andauthored
Update go driver version handling (#56)
Co-authored-by: Andreas Braun <[email protected]>
1 parent 328f05d commit b32c15d

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

golang/pre-publish/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ inputs:
1111
runs:
1212
using: composite
1313
steps:
14+
- name: Set up environment
15+
shell: bash
16+
run:
17+
bash ${{ github.action_path }}/set-environment.sh
18+
env:
19+
VERSION: "${{ inputs.version }}"
1420
- uses: mongodb-labs/drivers-github-tools/bump-version@v2
1521
with:
1622
version: ${{ inputs.version }}
1723
version_bump_script: "go run ${{ github.action_path }}/bump-version.go"
18-
commit_template: "BUMP v${VERSION}"
24+
commit_template: "${{ env.COMMIT_TEMPLATE }}"
1925
push_commit: ${{ inputs.push_changes }}
2026
- uses: mongodb-labs/drivers-github-tools/tag-version@v2
2127
with:
22-
version: v${{ inputs.version }}
28+
version: "${{ env.TAG_VERSION }}"
2329
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_ENV
13+
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV

0 commit comments

Comments
 (0)