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

Pass currentVersion in release workflow #70

Merged
merged 2 commits into from
Aug 23, 2024
Merged
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
20 changes: 14 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ on:
description: "Suffix to add to version number for marking as a pre-release alpha or beta client. Value ignored when isPrerelease is false"
required: false
type: string
default: "alpha1"
default: ""

jobs:
bump-version-and-release:
runs-on: ubuntu-latest

env:
SEMVER_VERSION: "" # Set by the get_tag_version step
PRERELEASE_SUFFIX: "" # Set by the set_prerelease_suffix step
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -47,21 +49,27 @@ jobs:
exit 1
fi

- name: Extract current release version through tag
- name: Extract current release version through tag and set SEMVER_VERSION
id: get_tag_version
run: |
tag=$(git describe --tags --abbrev=0)
semver=${tag#v} # Remove the 'v' prefix from version number
echo "Current Released Version: $semver"
echo "semver=$semver" >> $GITHUB_ENV # Set as environment variable
echo "SEMVER_VERSION=$semver" >> $GITHUB_ENV # Set as environment variable

- name: Set PRERELEASE_SUFFIX if isPrerelease is true
id: set_prerelease_suffix
if: ${{ inputs.isPrerelease == true }}
run: |
echo "PRERELEASE_SUFFIX=${{ inputs.prereleaseSuffix }}" >> $GITHUB_ENV

- name: Bump version
id: bump
uses: "./.github/actions/bump-version"
with:
versionFile: pinecone/__version__
currentVersion: ${{ env.SEMVER_VERSION}}
Comment on lines -62 to +70
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/pasta mistake from the original workflow I used as a template. The underlying bump-version action seems to work as expected and is unit tested, I just wasn't passing the proper input.

bumpType: ${{ inputs.releaseLevel }}
prereleaseSuffix: ${{ inputs.prereleaseSuffix }}
prereleaseSuffix: ${{ env.PRERELEASE_SUFFIX }}

- name: Verify unique release tag
run: |
Expand Down