-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Migrate to release please. (#21)
- Loading branch information
1 parent
8631c9e
commit e7ea77b
Showing
13 changed files
with
268 additions
and
28 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,21 @@ | ||
name: Build Documentation | ||
description: 'Build Documentation.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup dotnet build tools | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 9.0 | ||
- name: Install docfx | ||
shell: bash | ||
run: dotnet tool update -g docfx | ||
|
||
# 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 | ||
run: | | ||
docfx metadata | ||
docfx build |
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,27 @@ | ||
name: CI | ||
description: Runs CI for the .NET Server SDK | ||
inputs: | ||
sdk: | ||
description: 'The dotnet SDK to use.' | ||
required: false | ||
default: '9' | ||
target_test_framework: | ||
description: 'The target test framework to use.' | ||
required: false | ||
default: 'net9.0' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ inputs.sdk }} | ||
- run: dotnet restore src/LaunchDarkly.Logging.Microsoft | ||
env: | ||
BUILDFRAMEWORKS: netstandard2.1 | ||
TESTFRAMEWORK: ${{ inputs.target_test_framework }} | ||
shell: bash | ||
- run: dotnet build src/LaunchDarkly.Logging.Microsoft | ||
shell: bash | ||
- run: dotnet test test/LaunchDarkly.Logging.Microsoft.Tests | ||
shell: bash |
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,24 @@ | ||
name: Publish Documentation | ||
description: 'Publish the documentation to Github pages' | ||
inputs: | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
required: true | ||
token: | ||
description: 'Token to use for publishing.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
if: ${{ inputs.dry_run == 'false' }} | ||
name: 'Publish to Github pages' | ||
with: | ||
docs_path: docs | ||
github_token: ${{ inputs.token }} | ||
- name: Dry Run Publish | ||
if: ${{ inputs.dry_run == 'true' }} | ||
shell: bash | ||
run: | | ||
echo "This is a dry run and docs are not being published." |
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,18 @@ | ||
name: Release Build | ||
description: 'Build in Release Configuration' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup dotnet build tools | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 9.0 | ||
|
||
- name: Restore Packages | ||
shell: bash | ||
run: dotnet restore | ||
|
||
- name: Build | ||
shell: bash | ||
run: dotnet build /p:Configuration=Release ./src/LaunchDarkly.Logging.Microsoft/LaunchDarkly.Logging.Microsoft.csproj |
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,79 @@ | ||
name: Publish Package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
tag: | ||
description: 'Tag for provenance. For a dry run the value does not matter.' | ||
type: string | ||
required: true | ||
|
||
workflow_call: | ||
inputs: | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
tag: | ||
description: 'Tag for provenance' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # Needed if using OIDC to get release secrets. | ||
contents: write # Contents and pull-requests are for release-please to make releases. | ||
pull-requests: write | ||
|
||
steps: | ||
- 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, | ||
/production/common/releasing/nuget/api_key = NUGET_API_KEY' | ||
s3_path_pairs: 'launchdarkly-releaser/dotnet/LaunchDarkly.snk = LaunchDarkly.snk' | ||
|
||
- name: Build Release | ||
uses: ./.github/actions/build-release | ||
|
||
- name: Build Documentation | ||
uses: ./.github/actions/build-docs | ||
|
||
- name: Sign DLLs | ||
uses: launchdarkly/gh-actions/actions/[email protected] | ||
with: | ||
build_configuration_path: ./src/LaunchDarkly.Logging.Microsoft/bin/Release | ||
dll_name: LaunchDarkly.Logging.Microsoft.dll | ||
|
||
- name: Publish Nupkg | ||
id: publish | ||
uses: ./.github/actions/publish | ||
with: | ||
dry_run: ${{ inputs.dry_run }} | ||
|
||
- name: Publish Documentation | ||
uses: ./.github/actions/publish-docs | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
dry_run: ${{ inputs.dry_run }} | ||
|
||
provenance: | ||
if: ${{ inputs.dry_run == 'false' }} | ||
needs: ['publish'] | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
base64-subjects: "${{ needs.publish.outputs.hashes }}" | ||
upload-assets: true | ||
upload-tag-name: ${{ inputs.tag }} | ||
provenance-name: ${{ format('LaunchDarkly.Logging.Microsoft-{0}_provenance.intoto.jsonl', 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,34 @@ | ||
name: Release Please | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # Needed if using OIDC to get release secrets. | ||
contents: write # Contents and pull-requests are for release-please to make releases. | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: google-github-actions/release-please-action@v4 | ||
id: release | ||
with: | ||
command: manifest | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
default-branch: main | ||
|
||
ci: | ||
needs: ['release-please'] | ||
if: ${{ needs.release-please.outputs.releases_created == 'true' }} | ||
uses: ./.github/workflows/ci.yml | ||
publish: | ||
needs: ['release-please'] | ||
if: ${{ needs.release-please.outputs.releases_created == 'true' }} | ||
uses: ./.github/workflows/publish.yml | ||
with: | ||
dry_run: false | ||
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 |
---|---|---|
|
@@ -80,3 +80,5 @@ project.lock.json | |
|
||
*.snk | ||
*.p12 | ||
docs/ | ||
api/ |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{ | ||
".": "3.1.0" | ||
} |
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,48 @@ | ||
{ | ||
"metadata": [ | ||
{ | ||
"src": [ | ||
{ | ||
"src": "./src", | ||
"files": [ | ||
"**/*.csproj", | ||
"**/bin/**/**LaunchDarkly**.dll" | ||
] | ||
} | ||
], | ||
"dest": "./api", | ||
"properties" : { | ||
"Configuration": "Debug" | ||
} | ||
} | ||
], | ||
"build": { | ||
"content": [ | ||
{ | ||
"files": [ | ||
"**/*.{md,yml}" | ||
], | ||
"exclude": [ | ||
"docs/**" | ||
] | ||
} | ||
], | ||
"resource": [ | ||
{ | ||
"files": [ | ||
"images/**" | ||
] | ||
} | ||
], | ||
"output": "docs", | ||
"template": [ | ||
"default" | ||
], | ||
"globalMetadata": { | ||
"_appName": "LaunchDarkly Logging API for .NET - Microsoft.Extensions.Logging Adapter", | ||
"_appTitle": "LaunchDarkly Logging API for .NET - Microsoft.Extensions.Logging Adapter", | ||
"_enableSearch": true, | ||
"pdf": false | ||
} | ||
} | ||
} |
File renamed without changes.
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,8 @@ | ||
{ | ||
"packages": { | ||
".": { | ||
"release-type": "simple", | ||
"bootstrap-sha": "676c5a4b3763706c669c43117db19af8c5aeb80c" | ||
} | ||
} | ||
} |