Skip to content

Commit

Permalink
test matrix and pwd path
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Mar 9, 2023
1 parent cbebdc3 commit 1857ee3
Showing 1 changed file with 64 additions and 40 deletions.
104 changes: 64 additions & 40 deletions .github/workflows/update_golang_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ on:

jobs:
update_golang_version:
# strategy:
# matrix:
# branches: [ main, release-16.0, release-15.0, release-14.0 ]
strategy:
matrix:
branch: [ main ]
# branch: [ main, release-16.0, release-15.0, release-14.0 ]
name: Update Golang Version
runs-on: ubuntu-latest
steps:
Expand All @@ -19,45 +20,68 @@ jobs:
with:
go-version: 1.20.2

- name: Check out code into the Go module directory
- name: Check out code
uses: actions/checkout@v3

- name: Detect new version and update codebase
id: detect-and-update
- name: Detect new version
run: |
if [ ${{github.ref}} == "main" ]; then
go run ./go/tools/go-upgrade/go_upgrade.go --no-workflow-update --main --allow-major-upgrade
else
go run ./go/tools/go-upgrade/go_upgrade.go --no-workflow-update
fi
output=$(git status -s)
if [ -z "${output}" ]; then
exit 0
fi
echo "create-pr=true" >> $GITHUB_OUTPUT
go_version=$(go run ./go/tools/go-upgrade/go_upgrade.go get_go_version)
bootstrap_version=$(go run ./go/tools/go-upgrade/go_upgrade.go get_bootstrap_version)
echo "go-version=${go_version}" >> $GITHUB_OUTPUT
echo "bootstrap-version=${bootstrap_version}" >> $GITHUB_OUTPUT
pwd
ls
- name: Create Pull Request
if: steps.detect-and-update.outputs.create-pr == 'true'
uses: peter-evans/create-pull-request@v4
- name: Check out matrix branch
uses: actions/checkout@v3
with:
branch: "upgrade-go-to-${{steps.detect-and-update.outputs.go-version}}-on-${{github.ref}}"
commit-message: "bump go version to go${{steps.detect-and-update.outputs.go-version}}"
signoff: true
delete-branch: true
title: "Upgrade the Golang version to `go${{steps.detect-and-update.outputs.go-version}}`"
body: |
This Pull Request bumps the Golang version to `go${{steps.detect-and-update.outputs.go-version}}` and the bootstrap version to `${{steps.detect-and-update.outputs.bootstrap-version}}`.
There are a few manual steps remaining:
- Build and Push the bootstrap images to Docker Hub, the bot cannot handle that.
- Update the `./.github/workflows` file with the newer Golang version, the bot, also, cannot handle that due to permissions.
- To accomplish this, run the following: ``
base: "main" # TODO: remove, this is for test purposes
reviewers: |
frouioui
ref: ${{ matrix.branch }}
path: './vitess-to-upgrade/'

- name: Detect new version and update codebase
id: detect-and-update
run: |
pwd
ls
cd ..
pwd
ls
# if [ ${{github.ref}} == "main" ]; then
# go run ./go/tools/go-upgrade/go_upgrade.go --no-workflow-update --main --allow-major-upgrade
# else
# go run ./go/tools/go-upgrade/go_upgrade.go --no-workflow-update
# fi
#
# output=$(git status -s)
# if [ -z "${output}" ]; then
# exit 0
# fi
# echo "create-pr=true" >> $GITHUB_OUTPUT
#
# go_version=$(go run ./go/tools/go-upgrade/go_upgrade.go get_go_version)
# bootstrap_version=$(go run ./go/tools/go-upgrade/go_upgrade.go get_bootstrap_version)
# echo "go-version=${go_version}" >> $GITHUB_OUTPUT
# echo "bootstrap-version=${bootstrap_version}" >> $GITHUB_OUTPUT
#
# - name: Create Pull Request
# if: steps.detect-and-update.outputs.create-pr == 'true'
# uses: peter-evans/create-pull-request@v4
# with:
# branch: "upgrade-go-to-${{steps.detect-and-update.outputs.go-version}}-on-${{github.ref}}"
# commit-message: "bump go version to go${{steps.detect-and-update.outputs.go-version}}"
# signoff: true
# delete-branch: true
# title: "Upgrade the Golang version to `go${{steps.detect-and-update.outputs.go-version}}`"
# body: |
# This Pull Request bumps the Golang version to `go${{steps.detect-and-update.outputs.go-version}}` and the bootstrap version to `${{steps.detect-and-update.outputs.bootstrap-version}}`.
#
# There are a few manual steps remaining:
# - Build and Push the bootstrap images to Docker Hub, the bot cannot handle that.
# - Update the `./.github/workflows` file with the newer Golang version, the bot, also, cannot handle that due to permissions.
# - To accomplish this, run the following: ``
# base: "main" # TODO: remove, this is for test purposes
# reviewers: |
# frouioui
# labels: |
# Skip CI
# go
# Benchmark me
# Component: General
# Type: CI/Build
#

0 comments on commit 1857ee3

Please sign in to comment.