-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow to update go version
- Loading branch information
1 parent
5e60fcc
commit 0e701df
Showing
1 changed file
with
36 additions
and
0 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,36 @@ | ||
# As we're using CalVer, we need to update the major version of the go package every year | ||
# More info in this discussion: https://github.com/dask/dask-kubernetes/pull/731#discussion_r1226569925 | ||
name: "Update go package version" | ||
|
||
on: | ||
# FIXME: Testing only | ||
push: | ||
branches: | ||
- "add-operator-go-client" | ||
|
||
schedule: | ||
- cron: "0 0 1 1 *" # At 00:00 on January 1st | ||
workflow_dispatch: # To be able to debug this | ||
|
||
jobs: | ||
update-major-go-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Update go package version | ||
run: | | ||
PAST_YEAR=$(date -d "-1 year" +%Y) | ||
CURRENT_YEAR=$(date +%Y) | ||
sed -i "s/v${PAST_YEAR}/v${CURRENT_YEAR}/g" go.mod | ||
sed -i "s/v${PAST_YEAR}/v${CURRENT_YEAR}/g" dask_kubernetes/operator/go_client/hack/regenerate-code.sh | ||
sed -i "s/v${PAST_YEAR}/v${CURRENT_YEAR}/g" dask_kubernetes/operator/go_client/pkg/apis/kubernetes.dask.org/v1/register.go | ||
./dask_kubernetes/operator/go_client/hack/regenerate-code.sh | ||
- uses: peter-evans/create-pull-request@v4 | ||
with: | ||
commit-message: "Update major go package version" | ||
title: "Update major go package version" | ||
body: "Update major go package version" | ||
branch: "update-go-package-version" | ||
branch-suffix: "timestamp" | ||
# reviewers: "jacobtomlinson" # FIXME: Testing only | ||
delete-branch: true |