-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leaseweb CI
committed
Dec 20, 2024
1 parent
992cec7
commit d76ba3c
Showing
3 changed files
with
63 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Go Release Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release Go Project | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Go environment | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.18' # Specify your Go version | ||
|
||
# Step 3: Run go mod tidy and commit changes | ||
- name: Run go mod tidy | ||
run: | | ||
go mod tidy | ||
git config --global user.name "majidkarimizadeh" | ||
git config --global user.email "[email protected]" | ||
git diff --quiet || ( | ||
git add go.mod go.sum | ||
git commit -m "chore: tidy go.mod and go.sum" | ||
git push origin HEAD | ||
) | ||
# Step 4: Tag the release | ||
- name: Create a Git tag | ||
run: | | ||
VERSION="v0.0.1-$(git rev-parse --short HEAD)" | ||
git tag -a $VERSION -m "Release $VERSION" | ||
git push origin $VERSION | ||
# Step 5: Run GoReleaser to create the release | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
automerge: | ||
name: Enable Auto-Merge for Release Pull Requests | ||
runs-on: ubuntu-latest | ||
needs: release | ||
|
||
steps: | ||
- name: Enable Auto-Merge | ||
uses: "peter-evans/enable-pull-request-automerge@v2" | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
pull-request-number: ${{ github.event.pull_request.number }} | ||
merge-method: squash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
module github.com/leaseweb/leaseweb-go-sdk | ||
|
||
go 1.22.9 | ||
|
||
require ( | ||
github.com/leaseweb/leaseweb-go-sdk/abuse v0.0.0-20241219112543-85f6a9b47c9c | ||
github.com/leaseweb/leaseweb-go-sdk/aggregationpack v0.0.0-20241219112543-85f6a9b47c9c | ||
github.com/leaseweb/leaseweb-go-sdk/dedicatedserver v0.0.0-20241219112543-85f6a9b47c9c | ||
github.com/leaseweb/leaseweb-go-sdk/dns v0.0.0-20241219112543-85f6a9b47c9c | ||
github.com/leaseweb/leaseweb-go-sdk/invoice v0.0.0-20241219112543-85f6a9b47c9c | ||
github.com/leaseweb/leaseweb-go-sdk/publiccloud v0.0.0-20241219112543-85f6a9b47c9c | ||
) | ||
|
||
require gopkg.in/validator.v2 v2.0.1 // indirect |