Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ inputs:
description: 'The verbosity level of the test output.'
required: false
default: 'normal'
run_consul:
description: 'Run an instance of Consul'
required: false
default: false
run_dynamodb:
description: 'Run an instance of DynamoDB'
required: false
default: false
run_redis:
description: 'Run an instance of Redis'
required: false
default: false

runs:
using: composite
Expand All @@ -26,6 +38,24 @@ runs:
8.0
7.0

- name: Setup Consul if needed
uses: launchdarkly/gh-actions/actions/[email protected]
if: inputs.run_consul == 'true'
with:
consul: true

- name: Setup DynamoDB if needed
uses: launchdarkly/gh-actions/actions/[email protected]
if: inputs.run_dynamodb == 'true'
with:
dynamodb: true

- name: Setup Redis if needed
uses: launchdarkly/gh-actions/actions/[email protected]
if: inputs.run_redis == 'true'
with:
redis: true

- name: Copy global.json in place
shell: bash
run: cp global.example.json global.json
Expand Down
15 changes: 15 additions & 0 deletions .github/actions/full-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ inputs:
token:
description: 'The GitHub token to use for publishing documentation.'
required: true
run_consul:
description: 'Run an instance of Consul'
required: false
default: false
run_dynamodb:
description: 'Run an instance of DynamoDB'
required: false
default: false
run_redis:
description: 'Run an instance of Redis'
required: false
default: false
outputs:
hashes:
description: sha256sum hashes of built artifacts
Expand All @@ -38,6 +50,9 @@ runs:
with:
project_file: ${{ inputs.project_file }}
test_project_file: ${{ inputs.test_project_file }}
run_consul: ${{ inputs.run_consul }}
run_dynamodb: ${{ inputs.run_dynamodb }}
run_redis: ${{ inputs.run_redis }}

- uses: launchdarkly/gh-actions/actions/[email protected]
name: Get secrets
Expand Down
187 changes: 71 additions & 116 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ jobs:
runs-on: ubuntu-22.04

outputs:
package-sdk-client-released: ${{ steps.release.outputs['pkgs/sdk/client--release_created'] }}
package-sdk-client-tag_name: ${{ steps.release.outputs['pkgs/sdk/client--tag_name'] }}
package-sdk-server-ai-released: ${{ steps.release.outputs['pkgs/sdk/server-ai--release_created'] }}
package-sdk-server-ai-tag_name: ${{ steps.release.outputs['pkgs/sdk/server-ai--tag_name'] }}
package-sdk-server-consul-released: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-consul--release_created'] }}
package-sdk-server-consul-tag_name: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-consul--tag_name'] }}
package-sdk-server-dynamodb-released: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-dynamodb--release_created'] }}
package-sdk-server-dynamodb-tag_name: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-dynamodb--tag_name'] }}
package-sdk-server-redis-released: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-redis--release_created'] }}
package-sdk-server-redis-tag_name: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-redis--tag_name'] }}
package-sdk-server-released: ${{ steps.release.outputs['pkgs/sdk/server--release_created'] }}
package-sdk-server-tag_name: ${{ steps.release.outputs['pkgs/sdk/server--tag_name'] }}
package-sdk-server-telemetry-released: ${{ steps.release.outputs['pkgs/telemetry--release_created'] }}
package-sdk-server-telemetry-tag_name: ${{ steps.release.outputs['pkgs/telemetry--tag_name'] }}
package-sdk-server-ai-released: ${{ steps.release.outputs['pkgs/sdk/server-ai--release_created'] }}
package-sdk-server-ai-tag_name: ${{ steps.release.outputs['pkgs/sdk/server-ai--tag_name'] }}
package-sdk-client-released: ${{ steps.release.outputs['pkgs/sdk/client--release_created'] }}
package-sdk-client-tag_name: ${{ steps.release.outputs['pkgs/sdk/client--tag_name'] }}
tag_name: ${{ steps.release.outputs.tag_name }}

steps:
Expand All @@ -27,136 +33,85 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
target-branch: ${{ github.ref_name }}

release-sdk-server:
runs-on: ubuntu-22.04
# this job calls to the release-sdk-client workflow because the client SDK has to be built on macos
release-sdk-client:
needs: release-please
if: ${{ needs.release-please.outputs.package-sdk-client-released == 'true'}}
uses: ./.github/workflows/release-sdk-client.yml
with:
dry_run: false

# Client SDK provenance job (since it uses a different workflow)
release-sdk-client-provenance:
needs: ['release-please', 'release-sdk-client']
permissions:
actions: read
id-token: write
contents: write
pull-requests: write
if: ${{ needs.release-please.outputs.package-sdk-server-released == 'true'}}
outputs:
hashes: ${{ steps.full-release.outputs.hashes }}
steps:
- uses: actions/checkout@v4

- name: Setup Env from project's Env file
shell: bash
run: echo "$(cat pkgs/sdk/server/github_actions.env)" >> $GITHUB_ENV
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.release-sdk-client.outputs.hashes }}"
upload-assets: true
upload-tag-name: ${{ needs.release-please.outputs.package-sdk-client-tag_name }}
provenance-name: ${{ format('LaunchDarkly.ClientSdk-{0}_provenance.intoto.jsonl', needs.release-please.outputs.package-sdk-client-tag_name) }}

- uses: ./.github/actions/full-release
id: full-release
with:
workspace_path: ${{ env.WORKSPACE_PATH }}
project_file: ${{ env.PROJECT_FILE }}
build_output_path: ${{ env.BUILD_OUTPUT_PATH }}
test_project_file: ${{ env.TEST_PROJECT_FILE }}
dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }}
dry_run: false
aws_role: ${{ vars.AWS_ROLE_ARN }}
token: ${{ secrets.GITHUB_TOKEN }}
# Server packages using the shared release workflow
release-sdk-server:
needs: release-please
if: ${{ needs.release-please.outputs.package-sdk-server-released == 'true'}}
uses: ./.github/workflows/release.yml
with:
package_path: pkgs/sdk/server
dry_run: false
generate_provenance: true
tag_name: ${{ needs.release-please.outputs.package-sdk-server-tag_name }}

release-sdk-server-ai:
runs-on: ubuntu-22.04
needs: release-please
permissions:
id-token: write
contents: write
pull-requests: write
if: ${{ needs.release-please.outputs.package-sdk-server-ai-released == 'true'}}
outputs:
hashes: ${{ steps.full-release.outputs.hashes }}
steps:
- uses: actions/checkout@v4

- name: Setup Env from project's Env file
shell: bash
run: echo "$(cat pkgs/sdk/server-ai/github_actions.env)" >> $GITHUB_ENV

- uses: ./.github/actions/full-release
id: full-release
with:
workspace_path: ${{ env.WORKSPACE_PATH }}
project_file: ${{ env.PROJECT_FILE }}
build_output_path: ${{ env.BUILD_OUTPUT_PATH }}
test_project_file: ${{ env.TEST_PROJECT_FILE }}
dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }}
dry_run: false
aws_role: ${{ vars.AWS_ROLE_ARN }}
token: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/workflows/release.yml
with:
package_path: pkgs/sdk/server-ai
dry_run: false
generate_provenance: true
tag_name: ${{ needs.release-please.outputs.package-sdk-server-ai-tag_name }}

release-telemetry:
runs-on: ubuntu-22.04
needs: release-please
permissions:
id-token: write
contents: write
pull-requests: write
if: ${{ needs.release-please.outputs.package-sdk-server-telemetry-released == 'true'}}
outputs:
hashes: ${{ steps.full-release.outputs.hashes }}
steps:
- uses: actions/checkout@v4

- name: Setup Env from project's Env file
shell: bash
run: echo "$(cat pkgs/telemetry/github_actions.env)" >> $GITHUB_ENV

- uses: ./.github/actions/full-release
id: full-release
with:
workspace_path: ${{ env.WORKSPACE_PATH }}
project_file: ${{ env.PROJECT_FILE }}
build_output_path: ${{ env.BUILD_OUTPUT_PATH }}
test_project_file: ${{ env.TEST_PROJECT_FILE }}
dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }}
dry_run: false
aws_role: ${{ vars.AWS_ROLE_ARN }}
token: ${{ secrets.GITHUB_TOKEN }}

# this job calls to the release-sdk-client workflow because the client SDK has to be built on macos
release-sdk-client:
needs: release-please
if: ${{ needs.release-please.outputs.package-sdk-client-released == 'true'}}
uses: ./.github/workflows/release-sdk-client.yml
uses: ./.github/workflows/release.yml
with:
package_path: pkgs/telemetry
dry_run: false
generate_provenance: true
tag_name: ${{ needs.release-please.outputs.package-sdk-server-telemetry-tag_name }}

release-sdk-server-provenance:
needs: ['release-please', 'release-sdk-server']
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
release-sdk-server-redis:
needs: release-please
if: ${{ needs.release-please.outputs.package-sdk-server-redis-released == 'true'}}
uses: ./.github/workflows/release.yml
with:
base64-subjects: "${{ needs.release-sdk-server.outputs.hashes }}"
upload-assets: true
upload-tag-name: ${{ needs.release-please.outputs.package-sdk-server-tag_name }}
provenance-name: ${{ format('LaunchDarkly.ServerSdk-{0}_provenance.intoto.jsonl', needs.release-please.outputs.package-sdk-server-tag_name) }}
package_path: pkgs/dotnet-server-sdk-redis
dry_run: false
generate_provenance: true
tag_name: ${{ needs.release-please.outputs.package-sdk-server-redis-tag_name }}

release-telemetry-provenance:
needs: ['release-please', 'release-telemetry']
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
release-sdk-server-consul:
needs: release-please
if: ${{ needs.release-please.outputs.package-sdk-server-consul-released == 'true'}}
uses: ./.github/workflows/release.yml
with:
base64-subjects: "${{ needs.release-telemetry.outputs.hashes }}"
upload-assets: true
upload-tag-name: ${{ needs.release-please.outputs.package-sdk-server-telemetry-tag_name }}
provenance-name: ${{ format('LaunchDarkly.ServerSdk.Telemetry-{0}_provenance.intoto.jsonl', needs.release-please.outputs.package-sdk-server-telemetry-tag_name) }}
package_path: pkgs/dotnet-server-sdk-consul
dry_run: false
generate_provenance: true
tag_name: ${{ needs.release-please.outputs.package-sdk-server-consul-tag_name }}

release-sdk-client-provenance:
needs: ['release-please', 'release-sdk-client']
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
release-sdk-server-dynamodb:
needs: release-please
if: ${{ needs.release-please.outputs.package-sdk-server-dynamodb-released == 'true'}}
uses: ./.github/workflows/release.yml
with:
base64-subjects: "${{ needs.release-sdk-client.outputs.hashes }}"
upload-assets: true
upload-tag-name: ${{ needs.release-please.outputs.package-sdk-client-tag_name }}
provenance-name: ${{ format('LaunchDarkly.ClientSdk-{0}_provenance.intoto.jsonl', needs.release-please.outputs.package-sdk-client-tag_name) }}
package_path: pkgs/dotnet-server-sdk-dynamodb
dry_run: false
generate_provenance: true
tag_name: ${{ needs.release-please.outputs.package-sdk-server-dynamodb-tag_name }}
61 changes: 42 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,62 @@
name: Publish Package
name: Release Server Package
on:
workflow_dispatch:
inputs:
pkg_workspace:
package_path:
description: 'The package to publish'
required: true
type: choice
required: true
options:
# pkgs/sdk/client is omitted here since this workflow is for ubuntu and the client sdk build process requires macos. Use release-sdk-client for client sdk.
# pkgs/sdk/client is omitted here since this workflow is for ubuntu and the client sdk build process requires macos
- pkgs/dotnet-server-sdk-consul
- pkgs/dotnet-server-sdk-dynamodb
- pkgs/dotnet-server-sdk-redis
- pkgs/sdk/server
- pkgs/telemetry
- pkgs/sdk/server-ai
- pkgs/telemetry
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
generate_provenance:
description: 'Whether or not to generate provenance for this publish. Default behavior: generate only on main branch.'
type: choice
options:
- Default
- Generate
- Do not generate
description: 'Whether to generate provenance for this publish. Note: Workflow must be run from a tag (not a branch) for provenance generation to succeed.'
type: boolean
required: true
default: true
workflow_call:
inputs:
package_path:
description: 'Path to the package directory (e.g. pkgs/dotnet-server-sdk-redis)'
type: string
required: true
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
generate_provenance:
description: 'Whether to generate provenance for this publish.'
type: boolean
default: true
tag_name:
description: 'The tag name to use for the provenance file'
type: string
required: true

jobs:
build:
release:
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: write
pull-requests: write
outputs:
full-release-hashes: ${{ steps.full-release.outputs.hashes }}
hashes: ${{ steps.full-release.outputs.hashes }}
steps:
- uses: actions/checkout@v4

- name: Setup Env from project's Env file
shell: bash
run: echo "$(cat ${{ inputs.pkg_workspace }}/github_actions.env)" >> $GITHUB_ENV
run: echo "$(cat ${{ inputs.package_path }}/github_actions.env)" >> $GITHUB_ENV

- uses: ./.github/actions/full-release
id: full-release
Expand All @@ -49,17 +69,20 @@ jobs:
dry_run: ${{ inputs.dry_run }}
aws_role: ${{ vars.AWS_ROLE_ARN }}
token: ${{ secrets.GITHUB_TOKEN }}
run_consul: ${{ inputs.package_path == 'pkgs/dotnet-server-sdk-consul' }}
run_dynamodb: ${{ inputs.package_path == 'pkgs/dotnet-server-sdk-dynamodb' }}
run_redis: ${{ inputs.package_path == 'pkgs/dotnet-server-sdk-redis' }}

release-provenance:
needs: ['build']
needs: ['release']
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
if: |
(inputs.generate_provenance == 'Generate' || (inputs.generate_provenance == 'Default' && github.ref_name == 'main'))
if: inputs.generate_provenance
with:
base64-subjects: "${{ needs.build.outputs.full-release-hashes }}"
base64-subjects: "${{ needs.release.outputs.hashes }}"
upload-assets: true
provenance-name: ${{inputs.pkg_workspace}}_provenance.intoto.jsonl
upload-tag-name: ${{ inputs.tag_name }}
provenance-name: ${{ format('{0}_provenance.intoto.jsonl', inputs.tag_name) }}
Loading
Loading