Skip to content
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
8 changes: 3 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,6 @@ This section is dedicated to the maintainers of this project.

### Releases

Before running a release:

- **`meta/meta.go`**: The versions must be appropriately updated.

To cut a release, go to the repository in GitHub and click on the `Actions` tab.

Select the `Release` workflow on the left-hand menu.
Expand All @@ -352,4 +348,6 @@ Click on the `Run workflow` button.
Select the branch to cut the release from (default is main).

Input the `Release version number` which is the Semantic Release number including
the `v` prefix (i.e. `v1.4.0`) and click `Run workflow` to kickoff the release.
the `v` prefix (i.e. `v1.4.0` or `v1.4.0-alpha.1`) and click `Run workflow` to kickoff the release.

The (deprecated) version information in `meta/meta.go` will be updated automatically and a commit will be pushed.
25 changes: 22 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,26 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.changelog-version.outputs.version }}
version_only: ${{ steps.changelog-version.outputs.version_only }}
prerelease: ${{ steps.changelog-version.outputs.prerelease }}
steps:
- id: changelog-version
run: echo "version=$(echo "${{ inputs.versionNumber }}" | cut -c 2-)" >> "$GITHUB_OUTPUT"
run: |
version="${{ inputs.versionNumber }}"
version="${version#v}" # Remove leading "v" if present
version_only="${version%%-*}"
prerelease="${version#*-}"

# If there's no dash, set prerelease to empty
if [ "$version" = "$version_only" ]; then
prerelease=""
fi

{
echo "version=$version"
echo "version_only=$version_only"
echo "prerelease=$prerelease"
} >> "$GITHUB_OUTPUT"

changelog:
needs: [ changelog-version, meta-version ]
Expand Down Expand Up @@ -70,8 +87,10 @@ jobs:
# Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations
# More details: https://github.com/actions/checkout/blob/b4626ce19ce1106186ddf9bb20e706842f11a7c3/adrs/0153-checkout-v2.md#persist-credentials
persist-credentials: false
- name: Update meta package SDKVersion
run: sed -i "s/var SDKVersion =.*/var SDKVersion = \"${{ needs.changelog-version.outputs.version }}\"/" meta/meta.go
- name: Update meta package SDKVersion and SDKPrerelease
run: |
sed -i "s/var SDKVersion =.*/var SDKVersion = \"${{ needs.changelog-version.outputs.version_only }}\"/" meta/meta.go
sed -i "s/var SDKPrerelease =.*/var SDKPrerelease = \"${{ needs.changelog-version.outputs.prerelease }}\"/" meta/meta.go
Comment on lines +92 to +93
Copy link
Member

Choose a reason for hiding this comment

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

Honestly.... I'm wondering if we should just include the full version in SDKVersion and then the SDKPrerelease as the separated portion..

Because the SDKVersion shouldn't be v2.37.0 when we release this, it should really be v2.37.0-alpha.1. I don't think SDKPrerelease is super useful given that context, but since it exists, probably best to keep it up to date 😆

So when we release I think it'd make sense to be:

var SDKVersion = "v2.37.0-alpha.1"
var SDKPrerelease = "alpha.1"

Rather than:

var SDKVersion = "v2.37.0"
var SDKPrerelease = "alpha.1"

Copy link
Member

Choose a reason for hiding this comment

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

I guess maybe not because most of @bbasata's examples are using the SDKVersionString() instead, so it'd improperly format it then.... It's annoying these variables are exposed if we don't want people to reference them 😆

Copy link
Member

Choose a reason for hiding this comment

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

I guess also, all of this is deprecated anyways, so it doesn't really matter 🤷🏻

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm okay with prioritizing SDKVersionString() correctness. This is consistent with the doc comment for SDKVersion: The main version number that is being run at the moment.

- name: Git push meta
run: |
git config --global user.name "${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}"
Expand Down
Loading