Skip to content

Commit c8df4e6

Browse files
authored
Prepare 2.37.0-alpha.1 release (#1450)
* Handle pre-releases in Github Action updating meta.go * update CONTRIBUTING.md to reflect the current reality
1 parent 7821f30 commit c8df4e6

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,6 @@ This section is dedicated to the maintainers of this project.
339339

340340
### Releases
341341

342-
Before running a release:
343-
344-
- **`meta/meta.go`**: The versions must be appropriately updated.
345-
346342
To cut a release, go to the repository in GitHub and click on the `Actions` tab.
347343

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

354350
Input the `Release version number` which is the Semantic Release number including
355-
the `v` prefix (i.e. `v1.4.0`) and click `Run workflow` to kickoff the release.
351+
the `v` prefix (i.e. `v1.4.0` or `v1.4.0-alpha.1`) and click `Run workflow` to kickoff the release.
352+
353+
The (deprecated) version information in `meta/meta.go` will be updated automatically and a commit will be pushed.

.github/workflows/release.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,26 @@ jobs:
2020
runs-on: ubuntu-latest
2121
outputs:
2222
version: ${{ steps.changelog-version.outputs.version }}
23+
version_only: ${{ steps.changelog-version.outputs.version_only }}
24+
prerelease: ${{ steps.changelog-version.outputs.prerelease }}
2325
steps:
2426
- id: changelog-version
25-
run: echo "version=$(echo "${{ inputs.versionNumber }}" | cut -c 2-)" >> "$GITHUB_OUTPUT"
27+
run: |
28+
version="${{ inputs.versionNumber }}"
29+
version="${version#v}" # Remove leading "v" if present
30+
version_only="${version%%-*}"
31+
prerelease="${version#*-}"
32+
33+
# If there's no dash, set prerelease to empty
34+
if [ "$version" = "$version_only" ]; then
35+
prerelease=""
36+
fi
37+
38+
{
39+
echo "version=$version"
40+
echo "version_only=$version_only"
41+
echo "prerelease=$prerelease"
42+
} >> "$GITHUB_OUTPUT"
2643
2744
changelog:
2845
needs: [ changelog-version, meta-version ]
@@ -70,8 +87,10 @@ jobs:
7087
# Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations
7188
# More details: https://github.com/actions/checkout/blob/b4626ce19ce1106186ddf9bb20e706842f11a7c3/adrs/0153-checkout-v2.md#persist-credentials
7289
persist-credentials: false
73-
- name: Update meta package SDKVersion
74-
run: sed -i "s/var SDKVersion =.*/var SDKVersion = \"${{ needs.changelog-version.outputs.version }}\"/" meta/meta.go
90+
- name: Update meta package SDKVersion and SDKPrerelease
91+
run: |
92+
sed -i "s/var SDKVersion =.*/var SDKVersion = \"${{ needs.changelog-version.outputs.version_only }}\"/" meta/meta.go
93+
sed -i "s/var SDKPrerelease =.*/var SDKPrerelease = \"${{ needs.changelog-version.outputs.prerelease }}\"/" meta/meta.go
7594
- name: Git push meta
7695
run: |
7796
git config --global user.name "${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}"

0 commit comments

Comments
 (0)