Skip to content

Commit

Permalink
Add github workflow to update go version
Browse files Browse the repository at this point in the history
  • Loading branch information
bstadlbauer committed Jun 16, 2023
1 parent 5e60fcc commit 0e701df
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/update-go-package-version.yml
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

0 comments on commit 0e701df

Please sign in to comment.