Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions golang/pre-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ inputs:
runs:
using: composite
steps:
- name: Set up environment
shell: bash
run:
VERSION="${{ inputs.version }}" bash ${{ github.action_path }}/set-environment.sh
- 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
Loading