-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge private to public [v8] (#288)
Pulls in `release-please` configuration.
- Loading branch information
1 parent
21866d0
commit a7f369b
Showing
9 changed files
with
174 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Publish Artifacts | ||
description: 'Publish artifacts to Github Release' | ||
inputs: | ||
token: | ||
description: 'Token to use for publishing.' | ||
required: true | ||
dry-run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
required: false | ||
default: 'true' | ||
tag: | ||
description: 'Tag to upload artifacts to.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Git clean | ||
shell: bash | ||
run: git clean -f | ||
- name: Run Goreleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --clean ${{ inputs.dry-run == 'true' && '--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/*.deb ./dist/*.rpm ./dist/*.tar.gz ./dist/*.txt --clobber |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
name: Unit Tests | ||
description: "Runs Relay's unit tests + linters and optionally gathers coverage." | ||
inputs: | ||
go-version: | ||
description: 'Go version to use for build & test.' | ||
required: true | ||
lint: | ||
description: 'Whether to run linters.' | ||
required: false | ||
|
@@ -16,11 +13,11 @@ inputs: | |
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Go ${{ inputs.go-version }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ inputs.go-version }} | ||
|
||
- name: Get Go version | ||
id: go-version | ||
shell: bash | ||
run: | | ||
echo "version=$(go version | awk '{print $3}')" >> $GITHUB_OUTPUT | ||
- name: Lint | ||
if: inputs.lint == 'true' | ||
shell: bash | ||
|
@@ -36,7 +33,7 @@ runs: | |
if: steps.test.outcome == 'success' | ||
id: process-test | ||
shell: bash | ||
run: go-junit-reporter < raw_report.txt > junit_report.xml | ||
run: go run github.com/jstemmer/go-junit-[email protected] < raw_report.txt > junit_report.xml | ||
|
||
- name: Test with coverage | ||
if: inputs.coverage == 'true' | ||
|
@@ -48,12 +45,12 @@ runs: | |
if: steps.process-test.outcome == 'success' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Test-result-go${{ inputs.go-version }} | ||
name: Test-result-${{ steps.go-version.outputs.version }} | ||
path: junit_report.xml | ||
|
||
- name: Upload coverage results | ||
if: steps.test-coverage.outcome == 'success' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Coverage-result-go${{ inputs.go-version }} | ||
name: Coverage-result-${{ steps.go-version.outputs.version }} | ||
path: build/coverage* |
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
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
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Publish Images and Artifacts | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
description: 'Skip publishing to DockerHub' | ||
type: boolean | ||
required: false | ||
default: true | ||
tag: | ||
description: 'Tag to upload binary artifacts to.' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
go-versions: | ||
uses: ./.github/workflows/go-versions.yml | ||
|
||
build-publish: | ||
needs: go-versions | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # Needed to get Docker tokens during publishing. | ||
contents: write # Needed to upload release artifacts | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Go ${{ needs.go-versions.outputs.latest }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ needs.go-versions.outputs.latest }} | ||
- name: Build and Test | ||
uses: ./.github/actions/unit-tests | ||
- name: 'Get Docker token' | ||
uses: launchdarkly/gh-actions/actions/[email protected] | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/global/services/docker/public/username = DOCKER_USERNAME, /global/services/docker/public/token = DOCKER_TOKEN' | ||
- name: Publish Package | ||
uses: ./.github/actions/publish | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
dry-run: ${{ inputs.dry_run }} | ||
tag: ${{ inputs.tag }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Run Release Please | ||
|
||
on: | ||
push: | ||
branches: | ||
- v8 | ||
|
||
jobs: | ||
go-versions: | ||
uses: ./.github/workflows/go-versions.yml | ||
|
||
release-please: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
released_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}} | ||
|
||
release-relay: | ||
permissions: | ||
id-token: write # Needed to obtain Docker tokens | ||
contents: write # Needed to upload release artifacts | ||
|
||
needs: [ release-please, go-versions ] | ||
if: ${{ needs.release-please.outputs.release_created == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Get Docker token' | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/global/services/docker/public/username = DOCKER_USERNAME, /global/services/docker/public/token = DOCKER_TOKEN' | ||
|
||
- name: Setup Go ${{ needs.go-versions.outputs.latest }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ needs.go-versions.outputs.latest }} | ||
|
||
- uses: ./.github/actions/unit-tests | ||
|
||
- uses: ./.github/actions/publish | ||
with: | ||
dry-run: 'false' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ needs.release-please.outputs.tag_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"." : "8.2.3" | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"packages": { | ||
".": { | ||
"release-type": "go", | ||
"bump-minor-pre-major": true, | ||
"versioning": "default", | ||
"bootstrap-sha": "21866d02812c93457097540ee49f098bc405fdec", | ||
"include-component-in-tag" : false, | ||
"extra-files": [ | ||
"relay/version/version.go" | ||
] | ||
} | ||
} | ||
} |