Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements to bump and tag actions #33

Merged
merged 4 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 9 additions & 8 deletions bump-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
required: true
version_bump_script:
description: The version bump script
required: true
default: ''
commit_template:
description: The template for the git commit message
default: "BUMP ${VERSION}"
Expand All @@ -21,26 +21,27 @@ runs:
using: composite
steps:
- name: Set new version
if: ${{ inputs.version_bump_script != '' }}
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)
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}}
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
echo "Pushed version bump: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
else
echo "### Created version bump (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY
fi
echo "Created version bump (no push): ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
fi
16 changes: 8 additions & 8 deletions tag-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
default: "${VERSION}"
tag_message_template:
description: The template for the git tag message
default: "BUMP ${VERSION}"
default: "Release ${VERSION}"
push_tag:
description: Whether to push the tag
default: "true"
Expand All @@ -23,14 +23,14 @@ runs:
- name: Get the tag
shell: bash -eux {0}
run: |
export VERSION=${{inputs.version}}
export TAG=$(echo "${{inputs.tag_template}}" | envsubst)
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)
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
Expand All @@ -52,7 +52,7 @@ runs:
run: |
if [ ${{ inputs.push_tag }} == "true" ]; then
git push origin --tags
echo "### Pushed tag: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY
echo "Pushed tag: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
else
echo "### Created tag (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY
fi
echo "Created tag (no push): ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
fi
Loading