This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Adds LaunchDarkly.ServerSdk.Telemetry package and associated GA r…
…eorganization (#195) Adds LaunchDarkly.ServerSdk.Telemetry package and associated reorganization of Github Actions and Release Please configuration to support releasing multiple packages from this repository.
- Loading branch information
1 parent
5932385
commit 98fc994
Showing
254 changed files
with
726 additions
and
367 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 |
---|---|---|
@@ -1,17 +1,27 @@ | ||
name: Build Documentation | ||
description: 'Build Documentation.' | ||
inputs: | ||
workspace_path: | ||
description: 'Path to the workspace.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup dotnet build tools | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 6.0 | ||
- name: Install docfx | ||
shell: bash | ||
run: dotnet tool update -g docfx | ||
- name: Run docfx metadata | ||
shell: bash | ||
run: docfx metadata | ||
- name: Run docfx build | ||
|
||
# Note: in the docfx.json file, the 'Configuration' property is set to Debug so that we don't require | ||
# signing to happen just to build docs. | ||
- name: Build docs | ||
shell: bash | ||
# Note: in the docfx.json file, the 'Configuration' property is set to Debug so that we don't require | ||
# signing to happen just to build docs. | ||
run: docfx build | ||
run: | | ||
pushd ${{ inputs.workspace_path }} | ||
docfx metadata | ||
docfx build | ||
popd |
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 |
---|---|---|
@@ -1,22 +1,16 @@ | ||
name: CI | ||
description: Runs CI for the .NET Server SDK | ||
inputs: | ||
run_tests: | ||
description: 'If true, run unit tests, otherwise skip them.' | ||
project_file: | ||
description: 'Path to the project file.' | ||
required: true | ||
test_project_file: | ||
description: 'Path to the test project file. If provided, run unit tests, otherwise skip them.' | ||
required: false | ||
default: 'true' | ||
run_contract_tests: | ||
description: 'If true, run contract tests, otherwise skip them.' | ||
required: false | ||
default: 'true' | ||
aws_role_arn: | ||
description: 'The ARN of the role to assume for downloading secrets, used for building docs.' | ||
required: false | ||
default: '' | ||
token: | ||
description: 'Github token, used for contract tests' | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: composite | ||
|
@@ -28,41 +22,23 @@ runs: | |
|
||
- name: Restore Dependencies | ||
shell: bash | ||
run: dotnet restore src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj | ||
run: dotnet restore ${{ inputs.project_file }} | ||
|
||
- name: Build for NetStandard2.0 | ||
shell: bash | ||
run: dotnet build -p:Configuration=debug -p:TargetFramework=netstandard2.0 src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj | ||
run: dotnet build -p:Configuration=debug -p:TargetFramework=netstandard2.0 ${{ inputs.project_file }} | ||
|
||
- name: Build for Net6 | ||
shell: bash | ||
run: dotnet build -p:Configuration=debug -p:TargetFramework=net6.0 src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj | ||
run: dotnet build -p:Configuration=debug -p:TargetFramework=net6.0 ${{ inputs.project_file }} | ||
|
||
- name: Build for Net462 | ||
shell: bash | ||
run: dotnet build -p:Configuration=debug -p:TargetFramework=net462 src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj | ||
run: dotnet build -p:Configuration=debug -p:TargetFramework=net462 ${{ inputs.project_file }} | ||
|
||
- name: Run Unit Tests for Net6 | ||
if: ${{ inputs.run_tests == 'true' }} | ||
if: ${{ inputs.test_project_file != '' }} | ||
shell: bash | ||
run: | | ||
dotnet restore test/LaunchDarkly.ServerSdk.Tests | ||
dotnet test --framework=net6.0 test/LaunchDarkly.ServerSdk.Tests/LaunchDarkly.ServerSdk.Tests.csproj | ||
- name: Build Contract Tests | ||
if: ${{ inputs.run_contract_tests == 'true' }} | ||
shell: bash | ||
run: dotnet build /p:Configuration=debug contract-tests/TestService.csproj | ||
|
||
- name: Launch Contract Tests | ||
if: ${{ inputs.run_contract_tests == 'true' }} | ||
id: launch-contract-tests | ||
shell: bash | ||
run: dotnet contract-tests/bin/debug/net6.0/ContractTestService.dll > test-service.log 2>&1 & disown | ||
|
||
- name: Run Contract Tests | ||
if: ${{ inputs.run_contract_tests == 'true' }} | ||
uses: launchdarkly/gh-actions/actions/[email protected] | ||
with: | ||
test_service_port: 8000 | ||
token: ${{ inputs.token }} | ||
dotnet restore ${{ inputs.test_project_file }} | ||
dotnet test --framework=net6.0 ${{ inputs.test_project_file }} |
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,36 @@ | ||
name: Contract Tests | ||
description: Runs CI for the .NET Server SDK | ||
inputs: | ||
service_project_file: | ||
description: 'Path to the contract test service project file.' | ||
required: true | ||
service_dll_file: | ||
description: 'Path where compiled dll will be found.' | ||
required: true | ||
token: | ||
description: 'Github token, used for contract tests' | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup dotnet build tools | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 6.0 | ||
|
||
- name: Build Contract Tests | ||
shell: bash | ||
run: dotnet build /p:Configuration=debug ${{ inputs.service_project_file }} | ||
|
||
- name: Launch Contract Tests | ||
id: launch-contract-tests | ||
shell: bash | ||
run: dotnet ${{ inputs.service_dll_file }} > test-service.log 2>&1 & disown | ||
|
||
- name: Run Contract Tests | ||
uses: launchdarkly/gh-actions/actions/[email protected] | ||
with: | ||
test_service_port: 8000 | ||
token: ${{ inputs.token }} |
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,70 @@ | ||
name: Build, Test, and Publish | ||
description: 'Execute the full release process for a workspace.' | ||
inputs: | ||
workspace_path: | ||
description: 'Path to the workspace being released.' | ||
required: true | ||
project_file: | ||
description: 'Path to the project file.' | ||
required: true | ||
test_project_file: | ||
description: 'Path to the test project file. If provided, run unit tests, otherwise skip them.' | ||
required: false | ||
build_output_path: | ||
description: 'Build output path.' | ||
required: true | ||
dll_name: | ||
description: 'Build output dll name.' | ||
required: true | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: CI check | ||
uses: ./.github/actions/ci | ||
with: | ||
project_file: ${{ inputs.project_file }} | ||
test_project_file: ${{ inputs.test_project_file }} | ||
run_contract_tests: false | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: Get secrets | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/production/common/releasing/digicert/host = DIGICERT_HOST, | ||
/production/common/releasing/digicert/api_key = DIGICERT_API_KEY, | ||
/production/common/releasing/digicert/client_cert_file_b64 = DIGICERT_CLIENT_CERT_FILE_B64, | ||
/production/common/releasing/digicert/client_cert_password = DIGICERT_CLIENT_CERT_PASSWORD, | ||
/production/common/releasing/digicert/code_signing_cert_sha1_hash = DIGICERT_CODE_SIGNING_CERT_SHA1_HASH' | ||
s3_path_pairs: 'launchdarkly-releaser/dotnet/LaunchDarkly.snk = LaunchDarkly.snk' | ||
|
||
- name: Release build | ||
uses: ./.github/actions/build-release | ||
with: | ||
project_file: pkgs/sdk/server/src/LaunchDarkly.ServerSdk.csproj | ||
|
||
- name: Sign DLLs | ||
uses: launchdarkly/gh-actions/actions/[email protected] | ||
with: | ||
build_output_path: ${{ inputs.build_output_path }} | ||
dll_name: ${{ inputs.dll_name }} | ||
|
||
- name: Publish Nupkg | ||
uses: ./.github/actions/publish-package | ||
with: | ||
dry_run: ${{ inputs.dry_run }} | ||
|
||
- name: Build Documentation | ||
uses: ./.github/actions/build-docs | ||
with: | ||
workspace_path: ${{ inputs.workspace_path }} | ||
|
||
- name: Publish Documentation | ||
uses: ./.github/actions/publish-docs | ||
with: | ||
workspace_path: ${{ inputs.workspace_path }} | ||
token: ${{secrets.GITHUB_TOKEN}} |
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,6 +1,9 @@ | ||
name: Publish Documentation | ||
description: 'Publish the documentation to Github pages' | ||
inputs: | ||
workspace_path: | ||
description: 'Path to the workspace being released.' | ||
required: true | ||
token: | ||
description: 'Token to use for publishing.' | ||
required: true | ||
|
@@ -11,5 +14,5 @@ runs: | |
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Publish to Github pages' | ||
with: | ||
docs_path: docs | ||
docs_path: ${{ inputs.workspace_path }}/docs | ||
github_token: ${{ inputs.token }} |
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,42 @@ | ||
name: Manual Publish Package | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pkg_name: | ||
description: 'The package to publish' | ||
required: true | ||
type: choice | ||
options: | ||
- LaunchDarkly.ServerSdk | ||
- LaunchDarkly.ServerSdk.Telemetry | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- uses: ./.github/workflows/full-release.yml | ||
if: ${{ inputs.pkg_name == 'LaunchDarkly.ServerSdk' }} | ||
with: | ||
workspace_path: 'pkgs/sdk/server' | ||
project_file: 'pkgs/sdk/server/src/LaunchDarkly.ServerSdk.csproj' | ||
test_project_file: 'pkgs/sdk/server/test/LaunchDarkly.ServerSdk.Tests.csproj' | ||
build_output_path: 'pkgs/sdk/server/src/bin/Release/' | ||
dll_name: 'LaunchDarkly.ServerSdk.dll' | ||
dry_run: false | ||
|
||
- uses: ./.github/workflows/full-release.yml | ||
if: ${{ inputs.pkg_name == 'LaunchDarkly.ServerSdk.Telemetry' }} | ||
with: | ||
workspace_path: 'pkgs/telemetry' | ||
project_file: 'pkgs/telemetry/src/LaunchDarkly.ServerSdk.Telemetry.csproj' | ||
test_project_file: 'pkgs/telemetry/test/LaunchDarkly.ServerSdk.Telemetry.Tests.csproj' | ||
build_output_path: 'pkgs/telemetry/src/bin/Release/' | ||
dll_name: 'LaunchDarkly.ServerSdk.Telemetry.dll' | ||
dry_run: false |
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
Oops, something went wrong.