-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bump-version and tag-version scripts (#32)
Co-authored-by: Andreas Braun <[email protected]>
- Loading branch information
Showing
6 changed files
with
170 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Bump Version | ||
description: Bump the version and push if not a dry-run | ||
inputs: | ||
version: | ||
description: The new version | ||
required: true | ||
version_bump_script: | ||
description: The version bump script | ||
required: true | ||
commit_template: | ||
description: The template for the git commit message | ||
default: "BUMP ${VERSION}" | ||
push_commit: | ||
description: Whether to push the commit | ||
default: "true" | ||
artifactory_image: | ||
description: "Image to use for artifactory" | ||
default: release-tools-container-registry-local/garasign-git | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set new version | ||
shell: bash -eux {0} | ||
run: | | ||
${{ inputs.version_bump_script }} ${{ inputs.version }} | ||
- name: Get the commit message | ||
shell: bash -eux {0} | ||
run: | | ||
export VERSION=${{inputs.version}} | ||
export COMMIT_MESSAGE=$(echo "${{inputs.commit_template}}" | envsubst) | ||
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV | ||
- name: Commit the version bump | ||
uses: mongodb-labs/drivers-github-tools/git-sign@v2 | ||
with: | ||
command: git commit -a -m \"${{env.COMMIT_MESSAGE}}\" -s --gpg-sign=${{ env.GPG_KEY_ID }} | ||
artifactory_image: ${{inputs.artifactory_image}} | ||
- name: Push the commit to the source branch | ||
shell: bash -eux {0} | ||
run: | | ||
if [ ${{ inputs.push_commit }} == "true" ]; then | ||
git push origin | ||
echo "### Pushed version bump: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY | ||
else | ||
echo "### Created version bump (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Python Pre-Release | ||
description: Perform pre-release operations for Python Libraries | ||
inputs: | ||
version: | ||
description: The published version | ||
required: true | ||
version_bump_script: | ||
description: The version bump script | ||
required: true | ||
dry_run: | ||
description: Whether this is a dry run | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: Set version | ||
uses: blink1073/drivers-github-tools/bump-version@bump-version | ||
with: | ||
version: ${{ inputs.version }} | ||
version_bump_script: ${{ inputs.version_bump_script }} | ||
dry_run: ${{ inputs.dry_run }} | ||
- name: Tag version | ||
uses: blink1073/drivers-github-tools/tag-version@bump-version | ||
with: | ||
version: ${{ inputs.version }} | ||
dry_run: ${{ inputs.dry_run }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Bump Version | ||
description: Bump the version and push if not a dry-run | ||
inputs: | ||
version: | ||
description: The new version | ||
required: true | ||
tag_template: | ||
description: The template for the git tag | ||
default: "${VERSION}" | ||
tag_message_template: | ||
description: The template for the git tag message | ||
default: "BUMP ${VERSION}" | ||
push_tag: | ||
description: Whether to push the tag | ||
default: "true" | ||
artifactory_image: | ||
description: "Image to use for artifactory" | ||
default: release-tools-container-registry-local/garasign-git | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get the tag | ||
shell: bash -eux {0} | ||
run: | | ||
export VERSION=${{inputs.version}} | ||
export TAG=$(echo "${{inputs.tag_template}}" | envsubst) | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
- name: Get the tag message | ||
shell: bash -eux {0} | ||
run: | | ||
export VERSION=${{inputs.version}} | ||
export TAG_MESSAGE=$(echo "${{inputs.tag_message_template}}" | envsubst) | ||
echo "TAG_MESSAGE=$TAG_MESSAGE" >> $GITHUB_ENV | ||
- name: Tag the version | ||
uses: mongodb-labs/drivers-github-tools/git-sign@v2 | ||
with: | ||
command: git tag -a \"${{ env.TAG }}\" -m \"${{ env.TAG_MESSAGE }}\" -s --local-user=${{ env.GPG_KEY_ID }} | ||
artifactory_image: ${{ inputs.artifactory_image }} | ||
- name: Verify the tag | ||
shell: bash -eux {0} | ||
run: | | ||
if [ -n "$GPG_PUBLIC_URL" ]; then | ||
curl $GPG_PUBLIC_URL --output /tmp/signature.pub | ||
gpg --import /tmp/signature.pub | ||
git verify-tag $TAG | ||
else | ||
echo "Skipping tag verification" | ||
fi | ||
- name: Push the tag to the source branch | ||
shell: bash -eux {0} | ||
run: | | ||
if [ ${{ inputs.push_tag }} == "true" ]; then | ||
git push origin --tags | ||
echo "### Pushed tag: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY | ||
else | ||
echo "### Created tag (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY | ||
fi |