Update go package version #3
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
# 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: | |
schedule: | |
- cron: "0 0 2 1 *" # 00:00 UTC on the 2nd of January every year | |
jobs: | |
update-major-go-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Update go package version | |
run: | | |
PAST_YEAR=$(date -d "last 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" | |
delete-branch: true |