Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Ta/fake bugfix 3 #194

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4fb1a81
ci: build contract tests with net6.0 (#336)
cwaldren-ld Apr 5, 2024
99d32a0
ci: add hook error contract test support (#337)
cwaldren-ld Apr 10, 2024
e3bc4e0
ci: switch to Github Actions (#335)
cwaldren-ld Apr 11, 2024
3c6cdc9
ci: add release-please configuration and workflow (#338)
cwaldren-ld Apr 11, 2024
138f6d7
ci: fix package publishing bugs (#339)
cwaldren-ld Apr 12, 2024
5932385
feat: add OpenTelemetry tracing hook (#332)
cwaldren-ld Apr 17, 2024
4e458e5
feat: Adds LaunchDarkly.ServerSdk.Telemetry with a TracingHook implem…
tanderson-ld Apr 18, 2024
ffc7073
Updating packagess to pkgs and adding manual publish
tanderson-ld Apr 19, 2024
5ffae7c
Merge branch 'main' into ta/sc-236788/otel-package-squashed
tanderson-ld Apr 19, 2024
ffeb070
fixing names
tanderson-ld Apr 19, 2024
3956592
removing general ci workflow that is no longer required
tanderson-ld Apr 19, 2024
870e89b
Merge pull request #1 from tanderson-ld/ta/sc-236788/otel-package-squ…
tanderson-ld Apr 19, 2024
277b896
fix: fixing spelling mistake, wink wink
tanderson-ld Apr 19, 2024
96a8bc4
fix: fixing spelling mistake, wink wink
tanderson-ld Apr 19, 2024
c692c15
Merge pull request #2 from tanderson-ld/ta/fake-bugfix-1
tanderson-ld Apr 19, 2024
b442167
chore: release main (#3)
github-actions[bot] Apr 19, 2024
52113a2
fixing action invocation
tanderson-ld Apr 19, 2024
6ce958c
fix: another comment fix, wink wink (#4)
tanderson-ld Apr 19, 2024
4f91868
chore: release main (#5)
github-actions[bot] Apr 19, 2024
bf22b00
fixing checkout usage
tanderson-ld Apr 19, 2024
3450d34
fix: another
tanderson-ld Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/actions/build-docs/action.yml
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
6 changes: 5 additions & 1 deletion .github/actions/build-release/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build Action
description: 'Dotnet Server SDK Build action.'
inputs:
project_file:
description: 'Path to the project file.'
required: true

runs:
using: composite
Expand All @@ -15,4 +19,4 @@ runs:

- name: Build
shell: bash
run: dotnet build /p:Configuration=Release src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj
run: dotnet build /p:Configuration=Release ${{ inputs.project_file }}
48 changes: 12 additions & 36 deletions .github/actions/ci/action.yml
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
Expand All @@ -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 }}
36 changes: 36 additions & 0 deletions .github/actions/contract-tests/action.yml
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 }}
70 changes: 70 additions & 0 deletions .github/actions/full-release/action.yml
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}}
5 changes: 4 additions & 1 deletion .github/actions/publish-docs/action.yml
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
Expand All @@ -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 }}
5 changes: 4 additions & 1 deletion .github/actions/publish-package/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish Package
description: 'Packs DLLs into unsigned Nuget package and publishes to Nuget.'
inputs:
project_file:
description: 'Path to the project file.'
required: true
dry_run:
description: 'Is this a dry run. If so no package will be published.'
required: true
Expand All @@ -12,7 +15,7 @@ runs:
shell: bash
run: |
dotnet restore
dotnet pack --no-build --output nupkgs --configuration Release src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj
dotnet pack --no-build --output nupkgs --configuration Release ${{ inputs.project_file }}

- name: Publish Package
if: ${{ inputs.dry_run == 'false' }}
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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

#TODO: consider using inputs.pkg_name in place of those strings in the parameters
- 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
42 changes: 40 additions & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
on:
workflow_dispatch:
inputs:
workspace_path:
description: 'Path to the workspace being released.'
required: true
type: string
project_file:
description: 'Path to the project file.'
required: true
type: string
test_project_file:
description: 'Path to the test project file. If provided, run unit tests, otherwise skip them.'
required: false
type: string
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
workflow_call:
inputs:
workspace_path:
description: 'Path to the workspace being released.'
required: true
type: string
project_file:
description: 'Path to the project file.'
required: true
type: string
test_project_file:
description: 'Path to the test project file. If provided, run unit tests, otherwise skip them.'
required: false
type: string
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true

name: Publish Docs
jobs:
Expand All @@ -14,15 +48,19 @@ jobs:
name: Build and Test
uses: ./.github/actions/ci
with:
run_tests: true
run_contract_tests: false
project_file: pkgs/sdk/server/src/LaunchDarkly.ServerSdk.csproj
test_project_file: pkgs/sdk/server/test/LaunchDarkly.ServerSdk.Tests.csproj
token: ${{ secrets.GITHUB_TOKEN }}

- id: build-docs
name: Build Documentation
uses: ./.github/actions/build-docs
with:
workspace_path: ${{ inputs.workspace_path }}

- id: publish
name: Publish Documentation
uses: ./.github/actions/publish-docs
with:
workspace_path: ${{ inputs.workspace_path }}
token: ${{secrets.GITHUB_TOKEN}}
Loading
Loading