-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: cleaning up github actions paths, fixing publish docs params #8
Changes from all commits
1b0cd35
76aa5aa
7a6cb16
ab95844
feb2a3a
8a9632a
48644d2
826a1b7
11363cd
0e98150
d8ad24e
b3c606c
29c5819
281db44
d9758de
2d109b6
f3e4b79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,5 +33,5 @@ runs: | |
uses: launchdarkly/gh-actions/actions/[email protected] | ||
with: | ||
test_service_port: 8000 | ||
extra_params: '--status-timeout=120' | ||
extra_params: '--status-timeout=360' | ||
token: ${{ inputs.token }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,14 @@ name: Manual Publish Package | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
pkg_name: | ||
pkg_workspace: | ||
description: 'The package to publish' | ||
required: true | ||
type: choice | ||
options: | ||
- LaunchDarkly.ServerSdk | ||
- LaunchDarkly.ServerSdk.Telemetry | ||
- pkgs/sdk/client | ||
- pkgs/sdk/server | ||
- pkgs/telemetry | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
|
@@ -23,68 +24,41 @@ on: | |
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
runs-on: macos-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
outputs: | ||
server-sdk-hashes: ${{ steps.server-sdk-release.outputs.hashes }} | ||
telemetry-hashes: ${{ steps.telemetry-release.outputs.hashes }} | ||
full-release-hashes: ${{ steps.full-release.outputs.hashes }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reviewers: Commonizing |
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/full-release | ||
id: server-sdk-release | ||
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: ${{ inputs.dry_run }} | ||
aws_role: ${{ vars.AWS_ROLE_ARN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Env from project's Env file | ||
shell: bash | ||
run: echo "$(cat ${{ inputs.pkg_workspace }}/github_actions.env)" >> $GITHUB_ENV | ||
|
||
- uses: ./.github/actions/full-release | ||
id: telemetry-release | ||
if: ${{ inputs.pkg_name == 'LaunchDarkly.ServerSdk.Telemetry' }} | ||
id: full-release | ||
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' | ||
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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reviewers: the setup env action helps compartmentalize all the path strings |
||
dry_run: ${{ inputs.dry_run }} | ||
aws_role: ${{ vars.AWS_ROLE_ARN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
release-sdk-server-provenance: | ||
needs: ['build'] | ||
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')) && | ||
inputs.pkg_name == 'LaunchDarkly.ServerSdk' | ||
with: | ||
base64-subjects: "${{ needs.build.outputs.server-sdk-hashes }}" | ||
upload-assets: true | ||
provenance-name: ${{ 'LaunchDarkly.ServerSdk_provenance.intoto.jsonl' }} | ||
|
||
|
||
release-telemetry-server-provenance: | ||
release-provenance: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commonizing |
||
needs: ['build'] | ||
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')) && | ||
inputs.pkg_name == 'LaunchDarkly.ServerSdk.Telemetry' | ||
(inputs.generate_provenance == 'Generate' || (inputs.generate_provenance == 'Default' && github.ref_name == 'main')) | ||
with: | ||
base64-subjects: "${{ needs.build.outputs.telemetry-hashes }}" | ||
base64-subjects: "${{ needs.build.outputs.full-release-hashes }}" | ||
upload-assets: true | ||
provenance-name: ${{ 'LaunchDarkly.ServerSdk.Telemetry_provenance.intoto.jsonl' }} | ||
provenance-name: ${{inputs.pkg_workspace}}_provenance.intoto.jsonl |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,44 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
workspace_path: | ||
description: 'Path to the workspace being released.' | ||
pkg_workspace: | ||
description: 'The package to publish' | ||
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 | ||
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 | ||
type: choice | ||
options: | ||
- pkgs/sdk/client | ||
- pkgs/sdk/server | ||
- pkgs/telemetry | ||
|
||
name: Publish Docs | ||
jobs: | ||
build-publish: | ||
runs-on: ubuntu-latest | ||
runs-on: macos-latest | ||
permissions: | ||
contents: write # Needed in this case to write github pages. | ||
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 | ||
|
||
- id: build | ||
name: Build and Test SDK | ||
uses: ./.github/actions/ci | ||
with: | ||
project_file: ${{ inputs.project_file }} | ||
test_project_file: ${{ inputs.test_project_file }} | ||
project_file: ${{ env.PROJECT_FILE }} | ||
test_project_file: ${{ env.TEST_PROJECT_FILE }} | ||
|
||
- id: build-docs | ||
name: Build Documentation | ||
uses: ./.github/actions/build-docs | ||
with: | ||
workspace_path: ${{ inputs.workspace_path }} | ||
workspace_path: ${{ env.WORKSPACE_PATH }} | ||
|
||
- id: publish-docs | ||
name: Publish Documentation | ||
uses: ./.github/actions/publish-docs | ||
with: | ||
workspace_path: ${{ inputs.workspace_path }} | ||
workspace_path: ${{ env.WORKSPACE_PATH }} | ||
token: ${{secrets.GITHUB_TOKEN}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,15 @@ on: | |
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
runs-on: macos-latest | ||
|
||
outputs: | ||
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-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: | ||
|
@@ -24,7 +26,7 @@ jobs: | |
target-branch: ${{ github.ref_name }} | ||
|
||
release-sdk-server: | ||
runs-on: ubuntu-latest | ||
runs-on: macos-latest | ||
needs: release-please | ||
permissions: | ||
id-token: write | ||
|
@@ -35,55 +37,96 @@ jobs: | |
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: ./.github/actions/full-release | ||
id: full-release | ||
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' | ||
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 }} | ||
|
||
release-sdk-server-provenance: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reviewers: Moved provenance tasks to the bottom for organization. Made the diff weird. |
||
needs: ['release-please', 'release-sdk-server'] | ||
release-telemetry: | ||
runs-on: macos-latest | ||
needs: release-please | ||
permissions: | ||
actions: read | ||
id-token: write | ||
contents: write | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
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) }} | ||
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 | ||
|
||
release-telemetry: | ||
runs-on: ubuntu-latest | ||
- 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 }} | ||
|
||
release-sdk-client: | ||
runs-on: macos-latest | ||
needs: release-please | ||
permissions: | ||
id-token: write | ||
contents: write | ||
pull-requests: write | ||
if: ${{ needs.release-please.outputs.package-sdk-server-telemetry-released == 'true'}} | ||
if: ${{ needs.release-please.outputs.package-sdk-client-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/client/github_actions.env)" >> $GITHUB_ENV | ||
|
||
- uses: ./.github/actions/full-release | ||
id: full-release | ||
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' | ||
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 }} | ||
|
||
# TODO: refactor provenance | ||
release-sdk-server-provenance: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reviewers: Moved provenance tasks to the bottom for organization. Made the diff weird. |
||
needs: ['release-please', 'release-sdk-server'] | ||
permissions: | ||
actions: read | ||
id-token: write | ||
contents: write | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
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) }} | ||
|
||
|
||
release-telemetry-provenance: | ||
needs: ['release-please', 'release-telemetry'] | ||
permissions: | ||
|
@@ -96,3 +139,5 @@ jobs: | |
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) }} | ||
|
||
# TODO: add client provenance |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ jobs: | |
build-and-test: | ||
strategy: | ||
matrix: | ||
# TODO: Figure out mechanism to skip iOS framework on ubuntu and windows and re-add ubuntu and windows | ||
os: [macos-latest] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -23,6 +22,10 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Env from project's Env file | ||
shell: bash | ||
run: echo "$(cat pkgs/sdk/client/github_actions.env)" >> $GITHUB_ENV | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: Get secrets | ||
with: | ||
|
@@ -34,15 +37,17 @@ jobs: | |
|
||
- uses: ./.github/actions/ci | ||
with: | ||
project_file: pkgs/sdk/client/src/LaunchDarkly.ClientSdk.csproj | ||
test_project_file: pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj | ||
project_file: ${{ env.PROJECT_FILE}} | ||
test_project_file: ${{ env.TEST_PROJECT_FILE}} | ||
|
||
- uses: ./.github/actions/contract-tests | ||
with: | ||
service_project_file: pkgs/sdk/client/contract-tests/TestService.csproj | ||
service_dll_file: pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll | ||
service_project_file: ${{ env.CONTRACT_TEST_PROJECT_FILE}} | ||
service_dll_file: ${{ env.CONTRACT_TEST_DLL_FILE}} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: ./.github/actions/build-docs | ||
with: | ||
workspace_path: pkgs/sdk/client | ||
workspace_path: ${{ env.WORKSPACE_PATH}} | ||
|
||
# TODO: resolve issue with emulator and device tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reviewers: This is an existing TODO in the client-sdk repo that I am migrating here so we don't forget about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: Using macos-latest since mac is the lowest common denominator for platforms that supports all the client SDK target frameworks.