Go version update #6980
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
--- | |
name: Go version update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '45 * * * *' | |
permissions: | |
contents: read | |
jobs: | |
stable: | |
name: Stable | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: arnested/go-version-action@v1 | |
id: go-version | |
with: | |
patch-level: true | |
- name: Setup Go ${{ steps.go-version.outputs.latest }} | |
uses: WillAbides/[email protected] | |
with: | |
go-version: ${{ steps.go-version.outputs.latest }} | |
- run: go mod edit -go ${{ steps.go-version.outputs.latest }} | |
- run: git diff | |
- name: "Create pull request" | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: | | |
Update Go version to ${{ steps.go-version.outputs.latest }} | |
See the release history: https://go.dev/doc/devel/release#go${{ steps.go-version.outputs.latest }}. | |
branch: go-version-update | |
delete-branch: true | |
title: Update Go version to ${{ steps.go-version.outputs.latest }} | |
body: | | |
Update Go version to ${{ steps.go-version.outputs.latest }}. | |
See [the release history](https://go.dev/doc/devel/release#go${{ steps.go-version.outputs.latest }}). | |
token: ${{ secrets.PAT_TOKEN }} | |
unstable: | |
name: Unstable | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: arnested/go-version-action@v1 | |
id: go-version-stable | |
with: | |
patch-level: true | |
- uses: arnested/go-version-action@v1 | |
id: go-version-unstable | |
with: | |
patch-level: true | |
unstable: true | |
- name: Get draft release notes URL | |
if: steps.go-version-unstable.outputs.latest != steps.go-version-stable.outputs.latest | |
id: release-notes | |
run: | | |
# shellcheck disable=SC2086 | |
echo "URL=https://tip.golang.org/doc/go$(sed -E 's/([0-9]+\.[0-9]+).*/\1/' <<< '${{ steps.go-version-unstable.outputs.latest }}')" >> $GITHUB_OUTPUT | |
- name: Setup Go ${{ steps.go-version-unstable.outputs.latest }} | |
if: steps.go-version-unstable.outputs.latest != steps.go-version-stable.outputs.latest | |
uses: WillAbides/[email protected] | |
with: | |
go-version: ${{ steps.go-version-unstable.outputs.latest }} | |
- run: go mod edit -go ${{ steps.go-version-unstable.outputs.latest }} | |
if: steps.go-version-unstable.outputs.latest != steps.go-version-stable.outputs.latest | |
- run: git diff | |
if: steps.go-version-unstable.outputs.latest != steps.go-version-stable.outputs.latest | |
- name: "Create pull request" | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
draft: true | |
commit-message: | | |
Test Go unstable version ${{ steps.go-version-unstable.outputs.latest }} | |
See the draft release notes: ${{ steps.release-notes.outputs.URL }}. | |
branch: go-version-unstable-test | |
delete-branch: true | |
title: Test Go unstable version ${{ steps.go-version-unstable.outputs.latest }} | |
body: | | |
Test Go unstable version ${{ steps.go-version-unstable.outputs.latest }}. | |
See [the draft release notes](${{ steps.release-notes.outputs.URL }}). | |
This pull request is only intented for getting feedback on compatibility with future Go versions. Don't merge it! | |
token: ${{ secrets.PAT_TOKEN }} |