Skip to content

Commit ba4e416

Browse files
authored
chore: Migrate dotnet persistent store repos to mono repo (#101)
1 parent ddae814 commit ba4e416

File tree

84 files changed

+5690
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+5690
-135
lines changed

.github/actions/ci/action.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ inputs:
1515
description: 'The verbosity level of the test output.'
1616
required: false
1717
default: 'normal'
18+
run_consul:
19+
description: 'Run an instance of Consul'
20+
required: false
21+
default: false
22+
run_dynamodb:
23+
description: 'Run an instance of DynamoDB'
24+
required: false
25+
default: false
26+
run_redis:
27+
description: 'Run an instance of Redis'
28+
required: false
29+
default: false
1830

1931
runs:
2032
using: composite
@@ -26,6 +38,24 @@ runs:
2638
8.0
2739
7.0
2840
41+
- name: Setup Consul if needed
42+
uses: launchdarkly/gh-actions/actions/[email protected]
43+
if: inputs.run_consul == 'true'
44+
with:
45+
consul: true
46+
47+
- name: Setup DynamoDB if needed
48+
uses: launchdarkly/gh-actions/actions/[email protected]
49+
if: inputs.run_dynamodb == 'true'
50+
with:
51+
dynamodb: true
52+
53+
- name: Setup Redis if needed
54+
uses: launchdarkly/gh-actions/actions/[email protected]
55+
if: inputs.run_redis == 'true'
56+
with:
57+
redis: true
58+
2959
- name: Copy global.json in place
3060
shell: bash
3161
run: cp global.example.json global.json

.github/actions/full-release/action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ inputs:
2525
token:
2626
description: 'The GitHub token to use for publishing documentation.'
2727
required: true
28+
run_consul:
29+
description: 'Run an instance of Consul'
30+
required: false
31+
default: false
32+
run_dynamodb:
33+
description: 'Run an instance of DynamoDB'
34+
required: false
35+
default: false
36+
run_redis:
37+
description: 'Run an instance of Redis'
38+
required: false
39+
default: false
2840
outputs:
2941
hashes:
3042
description: sha256sum hashes of built artifacts
@@ -38,6 +50,9 @@ runs:
3850
with:
3951
project_file: ${{ inputs.project_file }}
4052
test_project_file: ${{ inputs.test_project_file }}
53+
run_consul: ${{ inputs.run_consul }}
54+
run_dynamodb: ${{ inputs.run_dynamodb }}
55+
run_redis: ${{ inputs.run_redis }}
4156

4257
- uses: launchdarkly/gh-actions/actions/[email protected]
4358
name: Get secrets

.github/workflows/release-please.yml

Lines changed: 71 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@ jobs:
1010
runs-on: ubuntu-22.04
1111

1212
outputs:
13+
package-sdk-client-released: ${{ steps.release.outputs['pkgs/sdk/client--release_created'] }}
14+
package-sdk-client-tag_name: ${{ steps.release.outputs['pkgs/sdk/client--tag_name'] }}
15+
package-sdk-server-ai-released: ${{ steps.release.outputs['pkgs/sdk/server-ai--release_created'] }}
16+
package-sdk-server-ai-tag_name: ${{ steps.release.outputs['pkgs/sdk/server-ai--tag_name'] }}
17+
package-sdk-server-consul-released: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-consul--release_created'] }}
18+
package-sdk-server-consul-tag_name: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-consul--tag_name'] }}
19+
package-sdk-server-dynamodb-released: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-dynamodb--release_created'] }}
20+
package-sdk-server-dynamodb-tag_name: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-dynamodb--tag_name'] }}
21+
package-sdk-server-redis-released: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-redis--release_created'] }}
22+
package-sdk-server-redis-tag_name: ${{ steps.release.outputs['pkgs/dotnet-server-sdk-redis--tag_name'] }}
1323
package-sdk-server-released: ${{ steps.release.outputs['pkgs/sdk/server--release_created'] }}
1424
package-sdk-server-tag_name: ${{ steps.release.outputs['pkgs/sdk/server--tag_name'] }}
1525
package-sdk-server-telemetry-released: ${{ steps.release.outputs['pkgs/telemetry--release_created'] }}
1626
package-sdk-server-telemetry-tag_name: ${{ steps.release.outputs['pkgs/telemetry--tag_name'] }}
17-
package-sdk-server-ai-released: ${{ steps.release.outputs['pkgs/sdk/server-ai--release_created'] }}
18-
package-sdk-server-ai-tag_name: ${{ steps.release.outputs['pkgs/sdk/server-ai--tag_name'] }}
19-
package-sdk-client-released: ${{ steps.release.outputs['pkgs/sdk/client--release_created'] }}
20-
package-sdk-client-tag_name: ${{ steps.release.outputs['pkgs/sdk/client--tag_name'] }}
2127
tag_name: ${{ steps.release.outputs.tag_name }}
2228

2329
steps:
@@ -27,136 +33,85 @@ jobs:
2733
token: ${{ secrets.GITHUB_TOKEN }}
2834
target-branch: ${{ github.ref_name }}
2935

30-
release-sdk-server:
31-
runs-on: ubuntu-22.04
36+
# this job calls to the release-sdk-client workflow because the client SDK has to be built on macos
37+
release-sdk-client:
3238
needs: release-please
39+
if: ${{ needs.release-please.outputs.package-sdk-client-released == 'true'}}
40+
uses: ./.github/workflows/release-sdk-client.yml
41+
with:
42+
dry_run: false
43+
44+
# Client SDK provenance job (since it uses a different workflow)
45+
release-sdk-client-provenance:
46+
needs: ['release-please', 'release-sdk-client']
3347
permissions:
48+
actions: read
3449
id-token: write
3550
contents: write
36-
pull-requests: write
37-
if: ${{ needs.release-please.outputs.package-sdk-server-released == 'true'}}
38-
outputs:
39-
hashes: ${{ steps.full-release.outputs.hashes }}
40-
steps:
41-
- uses: actions/checkout@v4
42-
43-
- name: Setup Env from project's Env file
44-
shell: bash
45-
run: echo "$(cat pkgs/sdk/server/github_actions.env)" >> $GITHUB_ENV
51+
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
52+
with:
53+
base64-subjects: "${{ needs.release-sdk-client.outputs.hashes }}"
54+
upload-assets: true
55+
upload-tag-name: ${{ needs.release-please.outputs.package-sdk-client-tag_name }}
56+
provenance-name: ${{ format('LaunchDarkly.ClientSdk-{0}_provenance.intoto.jsonl', needs.release-please.outputs.package-sdk-client-tag_name) }}
4657

47-
- uses: ./.github/actions/full-release
48-
id: full-release
49-
with:
50-
workspace_path: ${{ env.WORKSPACE_PATH }}
51-
project_file: ${{ env.PROJECT_FILE }}
52-
build_output_path: ${{ env.BUILD_OUTPUT_PATH }}
53-
test_project_file: ${{ env.TEST_PROJECT_FILE }}
54-
dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }}
55-
dry_run: false
56-
aws_role: ${{ vars.AWS_ROLE_ARN }}
57-
token: ${{ secrets.GITHUB_TOKEN }}
58+
# Server packages using the shared release workflow
59+
release-sdk-server:
60+
needs: release-please
61+
if: ${{ needs.release-please.outputs.package-sdk-server-released == 'true'}}
62+
uses: ./.github/workflows/release.yml
63+
with:
64+
package_path: pkgs/sdk/server
65+
dry_run: false
66+
generate_provenance: true
67+
tag_name: ${{ needs.release-please.outputs.package-sdk-server-tag_name }}
5868

5969
release-sdk-server-ai:
60-
runs-on: ubuntu-22.04
6170
needs: release-please
62-
permissions:
63-
id-token: write
64-
contents: write
65-
pull-requests: write
6671
if: ${{ needs.release-please.outputs.package-sdk-server-ai-released == 'true'}}
67-
outputs:
68-
hashes: ${{ steps.full-release.outputs.hashes }}
69-
steps:
70-
- uses: actions/checkout@v4
71-
72-
- name: Setup Env from project's Env file
73-
shell: bash
74-
run: echo "$(cat pkgs/sdk/server-ai/github_actions.env)" >> $GITHUB_ENV
75-
76-
- uses: ./.github/actions/full-release
77-
id: full-release
78-
with:
79-
workspace_path: ${{ env.WORKSPACE_PATH }}
80-
project_file: ${{ env.PROJECT_FILE }}
81-
build_output_path: ${{ env.BUILD_OUTPUT_PATH }}
82-
test_project_file: ${{ env.TEST_PROJECT_FILE }}
83-
dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }}
84-
dry_run: false
85-
aws_role: ${{ vars.AWS_ROLE_ARN }}
86-
token: ${{ secrets.GITHUB_TOKEN }}
72+
uses: ./.github/workflows/release.yml
73+
with:
74+
package_path: pkgs/sdk/server-ai
75+
dry_run: false
76+
generate_provenance: true
77+
tag_name: ${{ needs.release-please.outputs.package-sdk-server-ai-tag_name }}
8778

8879
release-telemetry:
89-
runs-on: ubuntu-22.04
9080
needs: release-please
91-
permissions:
92-
id-token: write
93-
contents: write
94-
pull-requests: write
9581
if: ${{ needs.release-please.outputs.package-sdk-server-telemetry-released == 'true'}}
96-
outputs:
97-
hashes: ${{ steps.full-release.outputs.hashes }}
98-
steps:
99-
- uses: actions/checkout@v4
100-
101-
- name: Setup Env from project's Env file
102-
shell: bash
103-
run: echo "$(cat pkgs/telemetry/github_actions.env)" >> $GITHUB_ENV
104-
105-
- uses: ./.github/actions/full-release
106-
id: full-release
107-
with:
108-
workspace_path: ${{ env.WORKSPACE_PATH }}
109-
project_file: ${{ env.PROJECT_FILE }}
110-
build_output_path: ${{ env.BUILD_OUTPUT_PATH }}
111-
test_project_file: ${{ env.TEST_PROJECT_FILE }}
112-
dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }}
113-
dry_run: false
114-
aws_role: ${{ vars.AWS_ROLE_ARN }}
115-
token: ${{ secrets.GITHUB_TOKEN }}
116-
117-
# this job calls to the release-sdk-client workflow because the client SDK has to be built on macos
118-
release-sdk-client:
119-
needs: release-please
120-
if: ${{ needs.release-please.outputs.package-sdk-client-released == 'true'}}
121-
uses: ./.github/workflows/release-sdk-client.yml
82+
uses: ./.github/workflows/release.yml
12283
with:
84+
package_path: pkgs/telemetry
12385
dry_run: false
86+
generate_provenance: true
87+
tag_name: ${{ needs.release-please.outputs.package-sdk-server-telemetry-tag_name }}
12488

125-
release-sdk-server-provenance:
126-
needs: ['release-please', 'release-sdk-server']
127-
permissions:
128-
actions: read
129-
id-token: write
130-
contents: write
131-
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
89+
release-sdk-server-redis:
90+
needs: release-please
91+
if: ${{ needs.release-please.outputs.package-sdk-server-redis-released == 'true'}}
92+
uses: ./.github/workflows/release.yml
13293
with:
133-
base64-subjects: "${{ needs.release-sdk-server.outputs.hashes }}"
134-
upload-assets: true
135-
upload-tag-name: ${{ needs.release-please.outputs.package-sdk-server-tag_name }}
136-
provenance-name: ${{ format('LaunchDarkly.ServerSdk-{0}_provenance.intoto.jsonl', needs.release-please.outputs.package-sdk-server-tag_name) }}
94+
package_path: pkgs/dotnet-server-sdk-redis
95+
dry_run: false
96+
generate_provenance: true
97+
tag_name: ${{ needs.release-please.outputs.package-sdk-server-redis-tag_name }}
13798

138-
release-telemetry-provenance:
139-
needs: ['release-please', 'release-telemetry']
140-
permissions:
141-
actions: read
142-
id-token: write
143-
contents: write
144-
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
99+
release-sdk-server-consul:
100+
needs: release-please
101+
if: ${{ needs.release-please.outputs.package-sdk-server-consul-released == 'true'}}
102+
uses: ./.github/workflows/release.yml
145103
with:
146-
base64-subjects: "${{ needs.release-telemetry.outputs.hashes }}"
147-
upload-assets: true
148-
upload-tag-name: ${{ needs.release-please.outputs.package-sdk-server-telemetry-tag_name }}
149-
provenance-name: ${{ format('LaunchDarkly.ServerSdk.Telemetry-{0}_provenance.intoto.jsonl', needs.release-please.outputs.package-sdk-server-telemetry-tag_name) }}
104+
package_path: pkgs/dotnet-server-sdk-consul
105+
dry_run: false
106+
generate_provenance: true
107+
tag_name: ${{ needs.release-please.outputs.package-sdk-server-consul-tag_name }}
150108

151-
release-sdk-client-provenance:
152-
needs: ['release-please', 'release-sdk-client']
153-
permissions:
154-
actions: read
155-
id-token: write
156-
contents: write
157-
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
109+
release-sdk-server-dynamodb:
110+
needs: release-please
111+
if: ${{ needs.release-please.outputs.package-sdk-server-dynamodb-released == 'true'}}
112+
uses: ./.github/workflows/release.yml
158113
with:
159-
base64-subjects: "${{ needs.release-sdk-client.outputs.hashes }}"
160-
upload-assets: true
161-
upload-tag-name: ${{ needs.release-please.outputs.package-sdk-client-tag_name }}
162-
provenance-name: ${{ format('LaunchDarkly.ClientSdk-{0}_provenance.intoto.jsonl', needs.release-please.outputs.package-sdk-client-tag_name) }}
114+
package_path: pkgs/dotnet-server-sdk-dynamodb
115+
dry_run: false
116+
generate_provenance: true
117+
tag_name: ${{ needs.release-please.outputs.package-sdk-server-dynamodb-tag_name }}

.github/workflows/release.yml

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,62 @@
1-
name: Publish Package
1+
name: Release Server Package
22
on:
33
workflow_dispatch:
44
inputs:
5-
pkg_workspace:
5+
package_path:
66
description: 'The package to publish'
7-
required: true
87
type: choice
8+
required: true
99
options:
10-
# 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.
10+
# pkgs/sdk/client is omitted here since this workflow is for ubuntu and the client sdk build process requires macos
11+
- pkgs/dotnet-server-sdk-consul
12+
- pkgs/dotnet-server-sdk-dynamodb
13+
- pkgs/dotnet-server-sdk-redis
1114
- pkgs/sdk/server
12-
- pkgs/telemetry
1315
- pkgs/sdk/server-ai
16+
- pkgs/telemetry
1417
dry_run:
1518
description: 'Is this a dry run. If so no package will be published.'
1619
type: boolean
1720
required: true
1821
generate_provenance:
19-
description: 'Whether or not to generate provenance for this publish. Default behavior: generate only on main branch.'
20-
type: choice
21-
options:
22-
- Default
23-
- Generate
24-
- Do not generate
22+
description: 'Whether to generate provenance for this publish. Note: Workflow must be run from a tag (not a branch) for provenance generation to succeed.'
23+
type: boolean
24+
required: true
25+
default: true
26+
workflow_call:
27+
inputs:
28+
package_path:
29+
description: 'Path to the package directory (e.g. pkgs/dotnet-server-sdk-redis)'
30+
type: string
31+
required: true
32+
dry_run:
33+
description: 'Is this a dry run. If so no package will be published.'
34+
type: boolean
35+
required: true
36+
generate_provenance:
37+
description: 'Whether to generate provenance for this publish.'
38+
type: boolean
39+
default: true
40+
tag_name:
41+
description: 'The tag name to use for the provenance file'
42+
type: string
43+
required: true
2544

2645
jobs:
27-
build:
46+
release:
2847
runs-on: ubuntu-22.04
2948
permissions:
3049
id-token: write
3150
contents: write
51+
pull-requests: write
3252
outputs:
33-
full-release-hashes: ${{ steps.full-release.outputs.hashes }}
53+
hashes: ${{ steps.full-release.outputs.hashes }}
3454
steps:
3555
- uses: actions/checkout@v4
3656

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

4161
- uses: ./.github/actions/full-release
4262
id: full-release
@@ -49,17 +69,20 @@ jobs:
4969
dry_run: ${{ inputs.dry_run }}
5070
aws_role: ${{ vars.AWS_ROLE_ARN }}
5171
token: ${{ secrets.GITHUB_TOKEN }}
72+
run_consul: ${{ inputs.package_path == 'pkgs/dotnet-server-sdk-consul' }}
73+
run_dynamodb: ${{ inputs.package_path == 'pkgs/dotnet-server-sdk-dynamodb' }}
74+
run_redis: ${{ inputs.package_path == 'pkgs/dotnet-server-sdk-redis' }}
5275

5376
release-provenance:
54-
needs: ['build']
77+
needs: ['release']
5578
permissions:
5679
actions: read
5780
id-token: write
5881
contents: write
5982
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
60-
if: |
61-
(inputs.generate_provenance == 'Generate' || (inputs.generate_provenance == 'Default' && github.ref_name == 'main'))
83+
if: inputs.generate_provenance
6284
with:
63-
base64-subjects: "${{ needs.build.outputs.full-release-hashes }}"
85+
base64-subjects: "${{ needs.release.outputs.hashes }}"
6486
upload-assets: true
65-
provenance-name: ${{inputs.pkg_workspace}}_provenance.intoto.jsonl
87+
upload-tag-name: ${{ inputs.tag_name }}
88+
provenance-name: ${{ format('{0}_provenance.intoto.jsonl', inputs.tag_name) }}

0 commit comments

Comments
 (0)