Skip to content

Commit

Permalink
chore: Switch to release-please and GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed Dec 10, 2024
1 parent fc10492 commit 86b378c
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "2.3.0"
}
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Is this a support request?**
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/hc/en-us/requests/new) or by emailing [email protected].

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.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.

**SDK version**
The version of this SDK that you are using.

**Language version, developer tools**
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.

**OS/platform**
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.

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Support request
url: https://support.launchdarkly.com/hc/en-us/requests/new
about: File your support requests with LaunchDarkly's support team
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
30 changes: 30 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI Workflow
description: 'Shared CI workflow.'
inputs:
run_linter:
description: 'If true, run linter.'
required: false
default: 'true'
smoke_test:
description: 'If true, run make docker-smokt-test.'
required: false
default: 'true'

runs:
using: composite
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.16
- name: Run tests
shell: bash
run: make test
- name: Run linter
if: ${{ inputs.run_linter == 'true' }}
shell: bash
run: make lint
- name: Run smoke test
if: ${{ inputs.run_smoke_test == 'true' }}
shell: bash
run: make docker-smoke-test
27 changes: 27 additions & 0 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Artifacts
description: 'Publish artifacts to Github Release'
inputs:
token:
description: 'Token to use for publishing.'
required: true
tag:
description: 'Tag to upload artifacts to.'
required: true

runs:
using: composite
steps:
- name: Run Goreleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean --skip=publish
env:
GITHUB_TOKEN: ${{ inputs.token }}

- name: Upload Release Artifacts
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: |
gh release upload ${{ inputs.tag }} ./dist/*.tar.gz ./dist/*.zip --clobber
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
**Requirements**

- [ ] I have added test coverage for new or changed functionality
- [ ] I have followed the repository's [pull request submission guidelines](../blob/master/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform versions

**Related issues**

Provide links to any issues in this repository or elsewhere relating to this pull request.

**Describe the solution you've provided**

Provide a clear and concise description of what you expect to happen.

**Describe alternatives you've considered**

Provide a clear and concise description of any alternative solutions or features you've considered.

**Additional context**

Add any other context about the pull request here.
13 changes: 13 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"packages" : {
"." : {
"release-type" : "go",
"bump-minor-pre-major" : true,
"versioning" : "default",
"include-component-in-tag" : false,
"extra-files" : [
"main.go"
]
}
}
}
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build and Test
on:
push:
branches: [ 'main' ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ 'main', 'feat/**' ]
paths-ignore:
- '**.md'

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/ci
12 changes: 12 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint PR title

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
lint-pr-title:
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
26 changes: 26 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run Release Please

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
target-branch: main

release-sdk-test-harness:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
uses: ./.github/workflows/release.yml
with:
tag: ${{ needs.release-please.outputs.tag_name }}
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Release

on:
workflow_call:
inputs:
tag:
required: true
description: 'The tag to upload release artifacts to.'
type: string
workflow_dispatch:
inputs:
tag:
description: 'The tag to upload release artifacts to.'
required: true
type: string

jobs:
release-sdk-test-harness:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for goreleaser to inspect tags.
- uses: ./.github/actions/ci
with:
run_linter: 'false'
smoke_test: 'false'
- uses: ./.github/actions/publish
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ inputs.tag }}
6 changes: 1 addition & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"log"
"os"
"strings"
"time"

"github.com/launchdarkly/sse-contract-tests/framework"
Expand All @@ -17,11 +16,8 @@ import (
const defaultPort = 8111
const statusQueryTimeout = time.Second * 10

//go:embed VERSION
var versionString string

func main() {
fmt.Printf("sse-contract-tests v%s\n", strings.TrimSpace(versionString))
fmt.Print("sse-contract-tests 2.3.0") // x-release-please-version

var params commandParams
if !params.Read(os.Args) {
Expand Down

0 comments on commit 86b378c

Please sign in to comment.