Skip to content

Commit b1a3481

Browse files
authored
chore: Migrate from releaser to release-please (#23)
1 parent 10b5083 commit b1a3481

File tree

18 files changed

+372
-16
lines changed

18 files changed

+372
-16
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is this a support request?**
11+
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing support@launchdarkly.com.
12+
13+
Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.
14+
15+
**Describe the bug**
16+
A clear and concise description of what the bug is.
17+
18+
**To reproduce**
19+
Steps to reproduce the behavior.
20+
21+
**Expected behavior**
22+
A clear and concise description of what you expected to happen.
23+
24+
**Logs**
25+
If applicable, add any log output related to your problem.
26+
27+
**SDK version**
28+
The version of this SDK that you are using.
29+
30+
**Language version, developer tools**
31+
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.
32+
33+
**OS/platform**
34+
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.
35+
36+
**Additional context**
37+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context about the feature request here.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Get Go Version
2+
description: "Gets the currently installed Go version."
3+
outputs:
4+
version:
5+
description: 'The currently installed Go version.'
6+
value: ${{ steps.go-version.outputs.value }}
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Get Go version
12+
id: go-version
13+
shell: bash
14+
run: |
15+
echo "value=$(go version | awk '{print $3}')" >> $GITHUB_OUTPUT
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Unit Tests
2+
description: "Runs SDK's unit tests + linters and optionally gathers coverage."
3+
inputs:
4+
lint:
5+
description: "Whether to run linters."
6+
required: false
7+
default: "false"
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- uses: ./.github/actions/get-go-version
13+
id: go-version
14+
- name: Lint
15+
if: inputs.lint == 'true'
16+
shell: bash
17+
run: make lint
18+
19+
- name: Test
20+
shell: bash
21+
id: test
22+
run: make test

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
**Requirements**
2+
3+
- [ ] I have added test coverage for new or changed functionality
4+
- [ ] I have followed the repository's [pull request submission guidelines](../blob/master/CONTRIBUTING.md#submitting-pull-requests)
5+
- [ ] I have validated my changes against all supported platform versions
6+
7+
**Related issues**
8+
9+
Provide links to any issues in this repository or elsewhere relating to this pull request.
10+
11+
**Describe the solution you've provided**
12+
13+
Provide a clear and concise description of what you expect to happen.
14+
15+
**Describe alternatives you've considered**
16+
17+
Provide a clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
21+
Add any other context about the pull request here.

.github/variables/go-versions.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
latest=1.24
2+
penultimate=1.23
3+
min=1.23
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Check Supported Go Versions
2+
on:
3+
schedule:
4+
- cron: "0 17 * * *"
5+
workflow_dispatch:
6+
7+
jobs:
8+
check-go-eol:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
latest: ${{ steps.parse.outputs.latest }}
12+
penultimate: ${{ steps.parse.outputs.penultimate }}
13+
timeout-minutes: 2
14+
steps:
15+
- uses: actions/checkout@v4
16+
# Perform a GET request to endoflife.date for the Go language. The response
17+
# contains all Go releases; we're interested in the 0'th and 1'th (latest and penultimate.)
18+
- name: Fetch officially supported Go versions
19+
uses: JamesIves/fetch-api-data-action@396ebea7d13904824f85b892b1616985f847301c
20+
with:
21+
endpoint: https://endoflife.date/api/go.json
22+
configuration: '{ "method": "GET" }'
23+
debug: true
24+
# Parse the response JSON and insert into environment variables for the next step.
25+
- name: Parse officially supported Go versions
26+
id: parse
27+
run: |
28+
echo "latest=${{ fromJSON(env.fetch-api-data)[0].cycle }}" >> $GITHUB_OUTPUT
29+
echo "penultimate=${{ fromJSON(env.fetch-api-data)[1].cycle }}" >> $GITHUB_OUTPUT
30+
31+
create-prs:
32+
permissions:
33+
contents: write
34+
pull-requests: write
35+
needs: check-go-eol
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
branch: ["main"]
40+
fail-fast: false
41+
env:
42+
officialLatestVersion: ${{ needs.check-go-eol.outputs.latest }}
43+
officialPenultimateVersion: ${{ needs.check-go-eol.outputs.penultimate }}
44+
steps:
45+
- uses: actions/checkout@v4
46+
with:
47+
ref: ${{ matrix.branch }}
48+
49+
- name: Get current Go versions
50+
id: go-versions
51+
run: cat ./.github/variables/go-versions.env > $GITHUB_OUTPUT
52+
53+
- name: Update go-versions.env and README.md
54+
if: steps.go-versions.outputs.latest != env.officialLatestVersion
55+
id: update-go-versions
56+
run: |
57+
sed -i -e "s#latest=[^ ]*#latest=${{ env.officialLatestVersion }}#g" \
58+
-e "s#penultimate=[^ ]*#penultimate=${{ env.officialPenultimateVersion }}#g" \
59+
./.github/variables/go-versions.env
60+
61+
- name: Create pull request
62+
if: steps.update-go-versions.outcome == 'success'
63+
uses: peter-evans/create-pull-request@c429d67da83f94001311bba6278e7e666bb828e3 # v6
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
add-paths: |
67+
.github/variables/go-versions.env
68+
branch: "launchdarklyreleasebot/update-to-go${{ env.officialLatestVersion }}-${{ matrix.branch }}"
69+
author: "LaunchDarklyReleaseBot <LaunchDarklyReleaseBot@launchdarkly.com>"
70+
committer: "LaunchDarklyReleaseBot <LaunchDarklyReleaseBot@launchdarkly.com>"
71+
labels: ${{ matrix.branch }}
72+
title: "ci: bump tested Go versions to ${{ env.officialLatestVersion }} and ${{ env.officialPenultimateVersion }}"
73+
commit-message: "Bumps from Go ${{ steps.go-versions.outputs.latest }} -> ${{ env.officialLatestVersion }} and ${{ steps.go-versions.outputs.penultimate }} -> ${{ env.officialPenultimateVersion }}."
74+
body: |
75+
- [ ] 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`)

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Test SDK
2+
on:
3+
push:
4+
branches: ["main", "feat/**"]
5+
paths-ignore:
6+
- "**.md" # Don't run CI on markdown changes.
7+
pull_request:
8+
branches: ["main", "feat/**"]
9+
paths-ignore:
10+
- "**.md"
11+
12+
jobs:
13+
go-versions:
14+
uses: ./.github/workflows/go-versions.yml
15+
16+
# Runs the common tasks (unit tests, lint, contract tests) for each Go version.
17+
test-linux:
18+
name: ${{ format('Linux, Go {0}', matrix.go-version) }}
19+
needs: go-versions
20+
strategy:
21+
# Let jobs fail independently, in case it's a single version that's broken.
22+
fail-fast: false
23+
matrix:
24+
go-version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}
25+
uses: ./.github/workflows/common_ci.yml
26+
with:
27+
go-version: ${{ matrix.go-version }}
28+
29+
test-windows:
30+
name: ${{ format('Windows, Go {0}', matrix.go-version) }}
31+
runs-on: windows-2022
32+
needs: go-versions
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
go-version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Setup Go ${{ matrix.go-version }}
40+
uses: actions/setup-go@v5
41+
with:
42+
go-version: ${{ matrix.go-version }}
43+
- name: Test
44+
run: go test -race ./...

.github/workflows/common_ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Common CI
2+
on:
3+
workflow_call:
4+
inputs:
5+
go-version:
6+
description: "Go version to use for the jobs."
7+
required: true
8+
type: string
9+
10+
jobs:
11+
unit-test:
12+
runs-on: ubuntu-latest
13+
name: "Unit Tests"
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Setup Go ${{ inputs.go-version }}
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: ${{ inputs.go-version }}
20+
- uses: ./.github/actions/unit-tests
21+
with:
22+
lint: "true"

.github/workflows/go-versions.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# The following chunk of yml boils down to pulling two Go version numbers out of a file and
2+
# making them available to the other workflows in a convenient fashion.
3+
#
4+
# It's a reusable workflow instead of an action so that its output can be used in a matrix strategy
5+
# of another job.
6+
#
7+
# The idea is to define the most recent, and penultimate, Go versions that should be used to test Relay.
8+
# Ideally we'd define these in a single place - otherwise we'd need to update many different places in
9+
# each workflow. This single place is .github/variables/go-versions.env.
10+
#
11+
# This reusable workflow grabs them out of the file, then sets them as outputs. As a convenience, it
12+
# also wraps each version in an array, so it can be directly used in a matrix strategy. Single-item matrices
13+
# are nice because you can tell instantly in the Github UI which version is being tested without needing
14+
# to inspect logs.
15+
#
16+
# To use a matrix output, e.g. latest version, do:
17+
# strategy:
18+
# matrix: ${{ fromJSON(this-job.outputs.latest-matrix) }}
19+
#
20+
name: Go Versions
21+
on:
22+
workflow_call:
23+
outputs:
24+
latest:
25+
description: 'The most recent Go version to test'
26+
value: ${{ jobs.go-versions.outputs.latest }}
27+
penultimate:
28+
description: 'The second most recent Go version to test'
29+
value: ${{ jobs.go-versions.outputs.penultimate }}
30+
min:
31+
description: 'The minimum Go version to test'
32+
value: ${{ jobs.go-versions.outputs.min }}
33+
matrix:
34+
description: 'All Go versions to test as a matrix'
35+
value: ${{ jobs.go-versions.outputs.all }}
36+
37+
jobs:
38+
go-versions:
39+
runs-on: ubuntu-latest
40+
outputs:
41+
latest: ${{ steps.set-env.outputs.latest }}
42+
penultimate: ${{ steps.set-env.outputs.penultimate }}
43+
all: ${{ steps.set-matrix.outputs.all }}
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Set Go Versions
47+
id: set-env
48+
run: cat ./.github/variables/go-versions.env > $GITHUB_OUTPUT
49+
- name: Set Go Version Matrices
50+
id: set-matrix
51+
run: |
52+
echo "all=[\"${{ steps.set-env.outputs.latest }}\",\"${{ steps.set-env.outputs.penultimate }}\",\"${{ steps.set-env.outputs.min }}\"]" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)