-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add github CI and release-please.
- Loading branch information
1 parent
f6ba29d
commit b2d384b
Showing
15 changed files
with
273 additions
and
90 deletions.
There are no files selected for viewing
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,13 @@ | ||
# Use a step like this to build documentation. | ||
name: Build Documentation | ||
description: 'Build Documentation.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build Documentation | ||
shell: bash | ||
run: | | ||
dotnet tool update -g docfx | ||
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,39 @@ | ||
# This is a composite to allow sharing these steps into other workflows. | ||
# For instance it could be used by regular CI as well as the release process. | ||
|
||
name: CI Workflow | ||
description: 'Shared CI workflow.' | ||
inputs: | ||
run_tests: | ||
description: 'If true, run unit tests, otherwise skip them.' | ||
required: false | ||
default: 'true' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup dotnet build tools | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0 | ||
|
||
- name: Restore dotnet dependencies | ||
shell: bash | ||
id: restore | ||
run: dotnet restore | ||
|
||
- name: Build | ||
shell: bash | ||
id: build | ||
run: dotnet build | ||
|
||
- name: Run Tests | ||
if: steps.build.outcome == 'success' && inputs.run_tests == 'true' | ||
shell: bash | ||
run: dotnet test | ||
|
||
# We build documentation during CI to ensure it can always build prior to a | ||
# release. | ||
- name: Build documentation | ||
if: steps.build.outcome == 'success' | ||
uses: ./.github/actions/build-docs |
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,19 @@ | ||
# Publish to github pages or to a different documentation system. | ||
|
||
name: Publish Documentation | ||
description: 'Publish the documentation to X' | ||
inputs: | ||
token: | ||
description: 'Token to use for publishing.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# This publishes a 'docs' folder to github pages. If you need to publish another way, | ||
# then you can just script it here, or call a script. | ||
- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1 | ||
name: 'Publish to Github pages' | ||
with: | ||
docs_path: docs | ||
github_token: { token } # For the shared action the token should be a 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Run CI | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ 'rlamb/github-ci-and-release' ] | ||
paths-ignore: | ||
- '**.md' # Do not need to run CI for markdown changes. | ||
pull_request: | ||
branches: [ 'rlamb/github-ci-and-release' ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
ci-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # If you only need the current version keep this. | ||
|
||
- uses: ./.github/actions/ci |
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,21 @@ | ||
on: | ||
workflow_dispatch: | ||
|
||
name: Publish Documentation | ||
jobs: | ||
build-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # Needed if using OIDC to get release secrets. | ||
contents: write # Needed in this case to write github pages. | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: build | ||
name: Build and Test | ||
uses: ./.github/actions/ci | ||
|
||
- id: publish | ||
name: Publish Documentation | ||
uses: ./.github/actions/publish-docs | ||
with: | ||
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Publish Package | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
prerelease: | ||
description: 'Is this a prerelease.' # use this to control publish tag, for instance NPM wouldn't set latest. | ||
type: boolean | ||
required: true | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
|
||
jobs: | ||
build-publish: | ||
runs-on: ubuntu-latest | ||
# Needed to get tokens during publishing. | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: build-and-test | ||
# Build using the same steps from CI. | ||
name: Build and Test | ||
uses: ./.github/actions/ci | ||
|
||
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0 | ||
name: 'Get your token!' | ||
with: | ||
# The AWS_ROLE_ARN needs added as a var to your repo. | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
# This example uses the node release token, it will get set into the NODE_AUTH_TOKEN | ||
# environment variable. The action readme contains more information. | ||
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN' | ||
|
||
- id: publish | ||
name: Publish Package | ||
uses: ./.github/actions/publish | ||
with: | ||
token: "Put your release secret or github token here." | ||
prerelease: ${{ inputs.prerelease }} | ||
dry_run: ${{ inputs.dry_run }} |
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,54 @@ | ||
name: Run Release Please | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-package: | ||
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@v3 | ||
id: release | ||
with: | ||
command: manifest | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
default-branch: main | ||
|
||
- uses: actions/checkout@v4 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
fetch-depth: 0 # If you only need the current version remove this line. | ||
|
||
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
name: 'Get your token!' | ||
with: | ||
# The AWS_ROLE_ARN needs added as a var to your repo. | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
# This example uses the node release token, it will get set into the NODE_AUTH_TOKEN | ||
# environment variable. The action readme contains more information. | ||
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN' | ||
|
||
- uses: ./.github/actions/ci | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- uses: ./.github/actions/publish | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
# If publishing somewhere else, then get the token from SSM. If you need both github, | ||
# and another token, then add more tokens to the composite action. Could be $NODE_AUTH_TOKEN | ||
# from the release-secrets action earlier in this workflow. | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- uses: ./.github/actions/publish-docs | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
# If publishing somewhere else, then get the token from SSM. If you need both github, | ||
# and another token, then add more tokens to the composite action. | ||
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 |
---|---|---|
|
@@ -80,3 +80,7 @@ project.lock.json | |
|
||
*.snk | ||
*.p12 | ||
|
||
_site/ | ||
docs/ | ||
api/ |
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,38 @@ | ||
{ | ||
"metadata": [ | ||
{ | ||
"src": [ | ||
{ | ||
"src": "./src", | ||
"files": [ | ||
"**/*.csproj" | ||
] | ||
} | ||
], | ||
"dest": "./api" | ||
} | ||
], | ||
"build": { | ||
"content": [ | ||
{ | ||
"files": [ | ||
"**/*.{md,yml}" | ||
], | ||
"exclude": [ | ||
"docs/**" | ||
] | ||
} | ||
], | ||
"output": "docs", | ||
"template": [ | ||
"default", | ||
"modern" | ||
], | ||
"globalMetadata": { | ||
"_appName": "Launchdarkly Logging Adapter For NLog", | ||
"_appTitle": "Launchdarkly Logging Adapter For NLog", | ||
"_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
2 changes: 1 addition & 1 deletion
2
test/LaunchDarkly.Logging.NLog.Tests/LaunchDarkly.Logging.NLog.Tests.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,2 @@ | ||
- name: API | ||
href: api/ |