Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: automatically create PR to update Go versions #308

Merged
merged 6 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/update_go_versions.md

This file was deleted.

51 changes: 36 additions & 15 deletions .github/workflows/check-go-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
check-go-eol:
needs: go-versions
permissions:
issues: write
contents: read
contents: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
Expand All @@ -36,17 +36,38 @@ jobs:
echo "officialLatestVersion=${{ fromJSON(env.fetch-api-data)[0].latest }}" >> $GITHUB_ENV
echo "officialPenultimateVersion=${{ fromJSON(env.fetch-api-data)[1].latest }}" >> $GITHUB_ENV

# If the latest official Go version is different from Relay's release version, generate an issue
# with useful details.
- name: Create issue if update required
if: inputs.force_create_issue || (needs.go-versions.outputs.latest != env.officialLatestVersion)
uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELAY_LATEST_VERSION: ${{ needs.go-versions.outputs.latest }}
OFFICIAL_LATEST_VERSION: ${{ env.officialLatestVersion }}
RELAY_PENULTIMATE_VERSION: ${{ needs.go-versions.outputs.penultimate }}
OFFICIAL_PENULTIMATE_VERSION: ${{ env.officialPenultimateVersion }}
- name: Run update script
if: needs.go-versions.outputs.latest != env.officialLatestVersion
id: update
run: ./scripts/update-go-release-version.sh ${{ env.officialLatestVersion }} ${{ env.officialPenultimateVersion }} \

- name: Create pull request
if: steps.update.outcome == 'success'
uses: peter-evans/create-pull-request@v6
with:
filename: .github/ISSUE_TEMPLATE/update_go_versions.md
update_existing: true
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
Dockerfile
.github/variables/go-versions.env
branch: "launchdarklyreleasebot/update-to-go-${{ env.officialLatestVersion }}"
author: "LaunchDarklyReleaseBot <[email protected]>"
committer: "LaunchDarklyReleaseBot <[email protected]>"
title: "fix(deps): bump supported Go versions to ${{ env.officialLatestVersion }} and ${{ env.officialPenultimateVersion }}"
commit-message: "Bumps from Go ${{ needs.go-versions.outputs.latest }} -> ${{ env.officialLatestVersion }} and ${{ needs.go-versions.outputs.penultimate }} -> ${{ env.officialPenultimateVersion }}."
body: |
It's time to update Relay's supported Go versions, due to a recent upstream Go release.

The Go major release cadence is ~every 6 months; the two most recent major versions are supported.
Note that between major releases, the Go team often ships multiple minor versions.


| | Current repo configuration | Desired repo configuration |
|-------------|------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| Latest | ${{ needs.go-versions.outputs.latest }} | [${{ env.officialLatestVersion }}](https://go.dev/doc/devel/release#go${{ env.officialLatestVersion }}) |
| Penultimate | ${{ needs.go-versions.outputs.penultimate }}| [${{ env.officialPenultimateVersion }}](https://go.dev/doc/devel/release#go${{ env.officialPenultimateVersion }}) |


Run locally:
```bash
./scripts/update-go-release-version.sh ${{ env.officialPenultimateVersion }} ${{ env.officialPenultimateVersion }}
```
Loading