Skip to content

Commit 1491df3

Browse files
committed
Add missing commands to push to remote
1 parent 9148a13 commit 1491df3

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

.github/workflows/release.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,46 @@ jobs:
1919
steps:
2020
- name: Check out code into the Go module directory
2121
uses: actions/checkout@v5
22-
with:
23-
fetch-depth: 0
24-
ref: ${{ github.event.inputs.mize_tag }}
22+
- name: Create a branch for the release
23+
run: |
24+
git config --global user.name 'github-actions'
25+
git config --global user.email '[email protected]'
26+
git config --global push.default current
27+
28+
go tool gorepomod prerelease "${{ github.events.inputs.kustomize_tag }}"
29+
2530
- name: Set up Go 1.x
2631
uses: actions/setup-go@v6
2732
with:
2833
go-version-file: go.work
2934
id: go
35+
3036
- name: Release kyaml
3137
run: |
3238
make IS_LOCAL=true verify-kustomize-repo
3339
go tool gorepomod release kyaml ${{ github.event.inputs.libs_tag }} --doIt
3440
./releasing/create-release.sh kyaml/${{ github.event.inputs.libs_tag }}
3541
go tool gorepomod pin kyaml --doIt
42+
git commit -m "Update kyaml to ${{ github.events.inputs.libs_tag }}"
43+
git push --force
3644
3745
- name: Release cmd/config
3846
run: |
3947
make IS_LOCAL=true verify-kustomize-repo
4048
go tool gorepomod release cmd/config ${{ github.event.inputs.libs_tag }} --doIt
4149
./releasing/create-release.sh cmd/config/${{ github.event.inputs.libs_tag }}
4250
go tool gorepomod pin cmd/config --doIt
51+
git commit -m "Update cmd/config to ${{ github.events.inputs.libs_tag }}"
52+
git push --force
4353
4454
- name: Release api
4555
run: |
4656
make IS_LOCAL=true verify-kustomize-repo
4757
go tool gorepomod release api ${{ github.event.inputs.libs_tag }} --doIt
4858
./releasing/create-release.sh api/${{ github.event.inputs.libs_tag }}
4959
go tool gorepomod pin api --doIt
60+
git commit -m "Update api to ${{ github.events.inputs.libs_tag }}"
61+
git push --force
5062
5163
- name: Release kustomize
5264
run: |
@@ -58,8 +70,6 @@ jobs:
5870
run: |
5971
git switch master
6072
git pull origin master
61-
git config --global user.name 'github-actions'
62-
git config --global user.email '[email protected]'
6373
sed -i "" "s/LATEST_RELEASE=.*/LATEST_RELEASE=${{ github.event.inputs.kustomize_tag }}/" Makefile
6474
source ./releasing/helpers.sh
6575
createBranch bumpMakefile "Update LATEST_RELEASE to ${{ github.event.inputs.kustomize_tag }}"

cmd/gorepomod/internal/repo/manager.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,6 @@ func (mgr *Manager) Release(
269269
if err := gr.FetchRemote(mgr.remoteName); err != nil {
270270
return err
271271
}
272-
if err := gr.CheckoutReleaseBranch(mgr.remoteName, relBranch); err != nil {
273-
return err
274-
}
275272
if err := gr.MergeFromRemoteBranch(mgr.remoteName, relBranch); err != nil {
276273
return err
277274
}

releasing/helpers.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,18 @@ function testKustomizeRepo {
3333
echo "LGTM"
3434
fi
3535
}
36+
37+
function nextVersion() {
38+
local release="$1";
39+
local libs_release="$2";
40+
41+
# Even if the major is bumped for kustomize, libs are bumped for minor.
42+
if [ "$release" = "major"]; then
43+
libs_release="minor";
44+
fi
45+
46+
kustomize_version=$(go tool gorepomod next "$release" kustomize)
47+
libs_version=$(go tool gorepomod next "$libs_release" kyaml cmd/config api)
48+
49+
gh workflow run release.yaml -f kustomize_tag="$kustomize_version" -f libs_version="$libs_version"
50+
}

0 commit comments

Comments
 (0)