Skip to content

Commit 49687af

Browse files
committed
fix(release): remove version bump automation to avoid branch protection conflicts
The release workflow was trying to auto-update version numbers in files and push to main, which conflicts with branch protection rules requiring PRs. This caused releases to fail. Changes: - Removed version extraction, checkout, update, and commit steps from workflow - Changed GNUmakefile VERSION to 'dev' (only used for local sideloading) - Changed README example to use '~> 1.0' (generic example version) - Updated release docs to reflect simplified process GoReleaser automatically uses the git tag version, so tracking versions in files is unnecessary. The workflow now simply builds and publishes from the tag without needing to push to main.
1 parent 88c6bf7 commit 49687af

File tree

3 files changed

+7
-45
lines changed

3 files changed

+7
-45
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,6 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19-
- name: Extract version from tag
20-
id: get_version
21-
run: |
22-
VERSION="${{ github.event.release.tag_name }}"
23-
# Remove 'v' prefix if present
24-
VERSION="${VERSION#v}"
25-
echo "version=$VERSION" >> $GITHUB_OUTPUT
26-
27-
- name: Checkout main branch
28-
run: |
29-
# Validate we're releasing from main branch
30-
if [ "${{ github.event.release.target_commitish }}" != "main" ]; then
31-
echo "Error: Release was not created from 'main' branch (target_commitish=${{ github.event.release.target_commitish }})."
32-
exit 1
33-
fi
34-
# Checkout main branch (release event checks out the tag, putting us in detached HEAD)
35-
git checkout main
36-
git pull origin main
37-
38-
- name: Update version in files
39-
run: |
40-
VERSION="${{ steps.get_version.outputs.version }}"
41-
# Update GNUmakefile
42-
sed -i -E "s/VERSION=[0-9]+\.[0-9]+\.[0-9]+/VERSION=$VERSION/" GNUmakefile
43-
# Update README.md
44-
sed -i -E "s/version = \"[0-9]+\.[0-9]+\.[0-9]+\"/version = \"$VERSION\"/" README.md
45-
echo "Updated version to $VERSION"
46-
47-
- name: Commit version changes back to main
48-
run: |
49-
git config user.name "github-actions[bot]"
50-
git config user.email "github-actions[bot]@users.noreply.github.com"
51-
git add GNUmakefile README.md
52-
# Commit if there are changes (may not be if version files already match)
53-
git diff --staged --quiet || git commit -m "chore: bump version to ${{ steps.get_version.outputs.version }}"
54-
# Push to main
55-
git push origin main
56-
5719
- name: Set up Go
5820
uses: actions/setup-go@v4
5921
with:

GNUmakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ GO111MODULE=on
1010

1111
PLUGINS_DIR=~/.terraform.d/plugins
1212
PLUGIN_PATH=onelogin.com/onelogin/onelogin
13-
VERSION=0.11.0
13+
# VERSION is only used for local development (make sideload)
14+
# For releases, GoReleaser uses the git tag version
15+
VERSION=dev
1416

1517
clean:
1618
rm -r ${DIST_DIR}

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ terraform {
3030
required_providers {
3131
onelogin = {
3232
source = "onelogin/onelogin"
33-
version = "0.11.0"
33+
version = "~> 1.0" # Use the latest version from the Terraform Registry
3434
}
3535
}
3636
}
@@ -84,11 +84,9 @@ To create a new release, simply publish a GitHub Release:
8484
5. Click **"Publish release"**
8585

8686
The Release workflow will automatically:
87-
- Extract the version from the tag (e.g., `v0.11.1``0.11.1`)
88-
- Update `VERSION` in `GNUmakefile` and the example provider configuration in `README.md`
89-
- Commit the version changes back to the main branch
90-
- Build the provider binaries with GoReleaser
91-
- Attach signed binaries to the GitHub release
87+
- Build the provider binaries with GoReleaser (using the tag version)
88+
- Generate checksums and sign them with GPG
89+
- Attach binaries and checksums to the GitHub release
9290
- Publish to the Terraform Registry
9391

9492
**That's it!** The entire release process is automated from a single GitHub Release creation.

0 commit comments

Comments
 (0)