-
Notifications
You must be signed in to change notification settings - Fork 80
91 lines (79 loc) · 4.36 KB
/
check-go-versions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Check Supported Go Versions
on:
schedule:
- cron: "0 17 * * *"
workflow_dispatch:
jobs:
check-go-eol:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.parse.outputs.latest }}
penultimate: ${{ steps.parse.outputs.penultimate }}
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
# Perform a GET request to endoflife.date for the Go language. The response
# contains all Go releases; we're interested in the 0'th and 1'th (latest and penultimate.)
- name: Fetch officially supported Go versions
uses: JamesIves/fetch-api-data-action@396ebea7d13904824f85b892b1616985f847301c
with:
endpoint: https://endoflife.date/api/go.json
configuration: '{ "method": "GET" }'
debug: true
# Parse the response JSON and insert into environment variables for the next step.
- name: Parse officially supported Go versions
id: parse
run: |
echo "latest=${{ fromJSON(env.fetch-api-data)[0].latest }}" >> $GITHUB_OUTPUT
echo "penultimate=${{ fromJSON(env.fetch-api-data)[1].latest }}" >> $GITHUB_OUTPUT
create-prs:
permissions:
contents: write
pull-requests: write
needs: check-go-eol
runs-on: ubuntu-latest
strategy:
matrix:
branch: ["v7", "v8"]
fail-fast: false
env:
officialLatestVersion: ${{ needs.check-go-eol.outputs.latest }}
officialPenultimateVersion: ${{ needs.check-go-eol.outputs.penultimate }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Get current Go versions
id: go-versions
run: cat ./.github/variables/go-versions.env > $GITHUB_OUTPUT
- name: Run update script
if: steps.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@6d6857d36972b65feb161a90e484f2984215f83e
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
Dockerfile
.github/variables/go-versions.env
branch: "launchdarklyreleasebot/update-to-go${{ env.officialLatestVersion }}-${{ matrix.branch }}"
author: "LaunchDarklyReleaseBot <LaunchDarklyReleaseBot@launchdarkly.com>"
committer: "LaunchDarklyReleaseBot <LaunchDarklyReleaseBot@launchdarkly.com>"
labels: ${{ matrix.branch }}
title: "fix(deps): bump supported Go versions to ${{ env.officialLatestVersion }} and ${{ env.officialPenultimateVersion }}"
commit-message: "Bumps from Go ${{ steps.go-versions.outputs.latest }} -> ${{ env.officialLatestVersion }} and ${{ steps.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 | ${{ steps.go-versions.outputs.latest }} | [${{ env.officialLatestVersion }}](https://go.dev/doc/devel/release#go${{ env.officialLatestVersion }}) |
| Penultimate | ${{ steps.go-versions.outputs.penultimate }}| [${{ env.officialPenultimateVersion }}](https://go.dev/doc/devel/release#go${{ env.officialPenultimateVersion }}) |
This PR's change was generated by running:
```bash
./scripts/update-go-release-version.sh ${{ env.officialLatestVersion }} ${{ env.officialPenultimateVersion }}
```
- [ ] I have triggered CI on this PR (either close & reopen this PR in Github UI, or `git commit -m "run ci" --allow-empty && git push`)