From 1b0cd350eacdf09ed2c0f6dbf6e656a97853ba3c Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 16:14:52 -0500 Subject: [PATCH 01/17] chore: cleaning up github actions paths, fixing publish docs params --- .github/actions/setup-env/action.yml | 53 ++++++++++++++++ .github/workflows/manual-publish.yml | 58 +++++------------ .github/workflows/publish-docs.yml | 47 +++++--------- .github/workflows/release-please.yml | 95 ++++++++++++++++++++-------- .github/workflows/sdk-client-ci.yml | 19 ++++-- .github/workflows/sdk-server-ci.yml | 16 +++-- .github/workflows/telemetry-ci.yml | 12 ++-- release-please-config.json | 2 +- 8 files changed, 186 insertions(+), 116 deletions(-) create mode 100644 .github/actions/setup-env/action.yml diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml new file mode 100644 index 00000000..e17672a5 --- /dev/null +++ b/.github/actions/setup-env/action.yml @@ -0,0 +1,53 @@ +name: Setup Package Environment +description: Based on the provided package name, this action will map and set up the necessary environment variables +inputs: + pkg_name: + description: 'The package this will setup the environment for' + required: true + +runs: + using: composite + steps: + - name: Setup env variables based on pkg_name + env: + PACKAGE_NAME: ${{ inputs.pkg_name }} + run: | + local WORKSPACE_PATH='' + local PROJECT_FILE='' + local BUILD_OUTPUT_PATH='' + local BUILD_OUTPUT_DLL_NAME='' + local TEST_PROJECT_FILE='' + local CONTRACT_TEST_PROJECT_FILE='' + local CONTRACT_TEST_DLL_FILE='' + + if [[ $PACKAGE_NAME == 'LaunchDarkly.ClientSdk' ]]; then + WORKSPACE_PATH='pkgs/sdk/client' + PROJECT_FILE='pkgs/sdk/client/src/LaunchDarkly.ClientSdk.csproj' + TEST_PROJECT_FILE='pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests.csproj' + BUILD_OUTPUT_PATH='pkgs/sdk/client/src/LaunchDarkly.ClientSdk/bin/Release/' + BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ClientSdk.dll' + CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/client/contract-tests/TestService.csproj' + CONTRACT_TEST_DLL_FILE='pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll' + + elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk' ]]; then + 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/' + BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.dll' + + elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk.Telemetry' ]]; then + 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/' + BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.Telemetry.dll' + fi + + echo "WORKSPACE_PATH=$WORKSPACE_PATH" >> $GITHUB_ENV + echo "PROJECT_FILE=$PROJECT_FILE" >> $GITHUB_ENV + echo "TEST_PROJECT_FILE=$TEST_PROJECT_FILE" >> $GITHUB_ENV + echo "BUILD_OUTPUT_PATH=$BUILD_OUTPUT_PATH" >> $GITHUB_ENV + echo "BUILD_OUTPUT_DLL_NAME=$BUILD_OUTPUT_DLL_NAME" >> $GITHUB_ENV + echo "CONTRACT_TEST_PROJECT_FILE=$CONTRACT_TEST_PROJECT_FILE" >> $GITHUB_ENV + echo "CONTRACT_TEST_DLL_NAME=$CONTRACT_TEST_DLL_NAME" >> $GITHUB_ENV diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index c74851e4..223bb452 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -9,6 +9,7 @@ on: options: - LaunchDarkly.ServerSdk - LaunchDarkly.ServerSdk.Telemetry + - LaunchDarkly.ClientSdk dry_run: description: 'Is this a dry run. If so no package will be published.' type: boolean @@ -23,58 +24,32 @@ 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 }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/full-release - id: server-sdk-release - if: ${{ inputs.pkg_name == 'LaunchDarkly.ServerSdk' }} + + - uses: ./.github/actions/setup-env 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 }} + workspace_path: ${{ inputs.pkg_name }} - 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 }} 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/generator_generic_slsa3.yml@v1.10.0 - 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: needs: ['build'] permissions: actions: read @@ -82,9 +57,8 @@ jobs: contents: write uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0 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' }} \ No newline at end of file + provenance-name: ${{inputs.pkg_name}}_provenance.intoto.jsonl diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index f14fbe4d..3deadaf0 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -1,57 +1,44 @@ on: workflow_dispatch: inputs: - workspace_path: - description: 'Path to the workspace being released.' + pkg_name: + 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: + - LaunchDarkly.ClientSdk + - LaunchDarkly.ServerSdk + - LaunchDarkly.ServerSdk.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 + + - uses: ./.github/actions/setup-env + with: + workspace_path: ${{ inputs.pkg_name }} + - 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}} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index cf4869b6..b0fb1b71 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -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,94 @@ jobs: hashes: ${{ steps.full-release.outputs.hashes }} steps: - uses: actions/checkout@v4 + + - uses: ./.github/actions/setup-env + with: + workspace_path: LaunchDarkly.ServerSdk + - 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' - dry_run: false + 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: ${{ inputs.dry_run }} aws_role: ${{ vars.AWS_ROLE_ARN }} token: ${{ secrets.GITHUB_TOKEN }} - release-sdk-server-provenance: - 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/generator_generic_slsa3.yml@v1.10.0 - 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 + - uses: ./.github/actions/setup-env + with: + workspace_path: LaunchDarkly.ServerSdk.Telemetry - release-telemetry: - runs-on: ubuntu-latest + - 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: ${{ inputs.dry_run }} + 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 + - uses: ./.github/actions/setup-env + with: + workspace_path: LaunchDarkly.ClientSdk + - 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' - dry_run: false + 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: ${{ inputs.dry_run }} aws_role: ${{ vars.AWS_ROLE_ARN }} token: ${{ secrets.GITHUB_TOKEN }} + # TODO: refactor provenance + 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/generator_generic_slsa3.yml@v1.10.0 + 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 +137,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 \ No newline at end of file diff --git a/.github/workflows/sdk-client-ci.yml b/.github/workflows/sdk-client-ci.yml index 2880f402..35b4e781 100644 --- a/.github/workflows/sdk-client-ci.yml +++ b/.github/workflows/sdk-client-ci.yml @@ -13,8 +13,7 @@ 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] + os: macos-latest fail-fast: false runs-on: ${{ matrix.os }} permissions: @@ -23,6 +22,10 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-env + with: + pkg_name: LaunchDarkly.ClientSdk + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 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 \ No newline at end of file diff --git a/.github/workflows/sdk-server-ci.yml b/.github/workflows/sdk-server-ci.yml index 2d672a66..3793d3a0 100644 --- a/.github/workflows/sdk-server-ci.yml +++ b/.github/workflows/sdk-server-ci.yml @@ -13,7 +13,7 @@ jobs: build-and-test: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: macos-latest fail-fast: false runs-on: ${{ matrix.os }} permissions: @@ -22,6 +22,10 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-env + with: + pkg_name: LaunchDarkly.ServerSdk + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 name: Get secrets with: @@ -29,15 +33,15 @@ jobs: - uses: ./.github/actions/ci with: - project_file: pkgs/sdk/server/src/LaunchDarkly.ServerSdk.csproj - test_project_file: pkgs/sdk/server/test/LaunchDarkly.ServerSdk.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/server/contract-tests/TestService.csproj - service_dll_file: pkgs/sdk/server/contract-tests/bin/debug/net6.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/server + workspace_path: ${{ env.WORKSPACE_PATH}} diff --git a/.github/workflows/telemetry-ci.yml b/.github/workflows/telemetry-ci.yml index 625f0c5b..d40fec3a 100644 --- a/.github/workflows/telemetry-ci.yml +++ b/.github/workflows/telemetry-ci.yml @@ -13,7 +13,7 @@ jobs: build-and-test: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: macos-latest fail-fast: false runs-on: ${{ matrix.os }} permissions: @@ -22,6 +22,10 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-env + with: + pkg_name: LaunchDarkly.ServerSdk + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 name: Get secrets with: @@ -29,9 +33,9 @@ jobs: - uses: ./.github/actions/ci with: - project_file: pkgs/telemetry/src/LaunchDarkly.ServerSdk.Telemetry.csproj - test_project_file: pkgs/telemetry/test/LaunchDarkly.ServerSdk.Telemetry.Tests.csproj + project_file: ${{ env.PROJECT_FILE}} + test_project_file: ${{ env.TEST_PROJECT_FILE}} - uses: ./.github/actions/build-docs with: - workspace_path: pkgs/telemetry + workspace_path: ${{ env.WORKSPACE_PATH}} diff --git a/release-please-config.json b/release-please-config.json index 7d1f82c7..ced71197 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,5 +1,5 @@ { - "bootstrap-sha": "7870a6ed7450d211ae822a281de45b6fc3df39c3", + "bootstrap-sha": "fedc48807cd2bb295f2e700352859779c0eea8c0", "separate-pull-requests": true, "include-component-in-tag": true, "packages": { From 76aa5aa95f604c830d746d4fa1dfadc3c699e95f Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 16:33:36 -0500 Subject: [PATCH 02/17] fixing action inputs --- .github/workflows/manual-publish.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- .github/workflows/release-please.yml | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index 223bb452..714b7ab3 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -35,7 +35,7 @@ jobs: - uses: ./.github/actions/setup-env with: - workspace_path: ${{ inputs.pkg_name }} + pkg_name: ${{ inputs.pkg_name }} - uses: ./.github/actions/full-release id: full-release diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 3deadaf0..61ac5d28 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -21,7 +21,7 @@ jobs: - uses: ./.github/actions/setup-env with: - workspace_path: ${{ inputs.pkg_name }} + pkg_name: ${{ inputs.pkg_name }} - id: build name: Build and Test SDK diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index b0fb1b71..77599b3f 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -40,7 +40,7 @@ jobs: - uses: ./.github/actions/setup-env with: - workspace_path: LaunchDarkly.ServerSdk + pkg_name: LaunchDarkly.ServerSdk - uses: ./.github/actions/full-release id: full-release @@ -50,7 +50,7 @@ jobs: build_output_path: ${{ env.BUILD_OUTPUT_PATH }} test_project_file: ${{ env.TEST_PROJECT_FILE }} dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }} - dry_run: ${{ inputs.dry_run }} + dry_run: false aws_role: ${{ vars.AWS_ROLE_ARN }} token: ${{ secrets.GITHUB_TOKEN }} @@ -68,7 +68,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-env with: - workspace_path: LaunchDarkly.ServerSdk.Telemetry + pkg_name: LaunchDarkly.ServerSdk.Telemetry - uses: ./.github/actions/full-release id: full-release @@ -78,7 +78,7 @@ jobs: build_output_path: ${{ env.BUILD_OUTPUT_PATH }} test_project_file: ${{ env.TEST_PROJECT_FILE }} dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }} - dry_run: ${{ inputs.dry_run }} + dry_run: false aws_role: ${{ vars.AWS_ROLE_ARN }} token: ${{ secrets.GITHUB_TOKEN }} @@ -96,7 +96,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-env with: - workspace_path: LaunchDarkly.ClientSdk + pkg_name: LaunchDarkly.ClientSdk - uses: ./.github/actions/full-release id: full-release @@ -106,7 +106,7 @@ jobs: build_output_path: ${{ env.BUILD_OUTPUT_PATH }} test_project_file: ${{ env.TEST_PROJECT_FILE }} dll_name: ${{ env.BUILD_OUTPUT_DLL_NAME }} - dry_run: ${{ inputs.dry_run }} + dry_run: false aws_role: ${{ vars.AWS_ROLE_ARN }} token: ${{ secrets.GITHUB_TOKEN }} From 7a6cb16a09e0649e068dace4a2305b8a467cf25f Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 16:38:10 -0500 Subject: [PATCH 03/17] fixing os matrix --- .github/workflows/sdk-client-ci.yml | 2 +- .github/workflows/sdk-server-ci.yml | 2 +- .github/workflows/telemetry-ci.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sdk-client-ci.yml b/.github/workflows/sdk-client-ci.yml index 35b4e781..5edeebff 100644 --- a/.github/workflows/sdk-client-ci.yml +++ b/.github/workflows/sdk-client-ci.yml @@ -13,7 +13,7 @@ jobs: build-and-test: strategy: matrix: - os: macos-latest + os: [macos-latest] fail-fast: false runs-on: ${{ matrix.os }} permissions: diff --git a/.github/workflows/sdk-server-ci.yml b/.github/workflows/sdk-server-ci.yml index 3793d3a0..21522457 100644 --- a/.github/workflows/sdk-server-ci.yml +++ b/.github/workflows/sdk-server-ci.yml @@ -13,7 +13,7 @@ jobs: build-and-test: strategy: matrix: - os: macos-latest + os: [macos-latest] fail-fast: false runs-on: ${{ matrix.os }} permissions: diff --git a/.github/workflows/telemetry-ci.yml b/.github/workflows/telemetry-ci.yml index d40fec3a..3354efdd 100644 --- a/.github/workflows/telemetry-ci.yml +++ b/.github/workflows/telemetry-ci.yml @@ -13,7 +13,7 @@ jobs: build-and-test: strategy: matrix: - os: macos-latest + os: [macos-latest] fail-fast: false runs-on: ${{ matrix.os }} permissions: From ab95844c81a1bb8bd608e9c3605a4dd3e2b2a950 Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 16:45:33 -0500 Subject: [PATCH 04/17] adding shell, actionlint didnt catch this --- .github/actions/setup-env/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index e17672a5..65bc7610 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -11,6 +11,7 @@ runs: - name: Setup env variables based on pkg_name env: PACKAGE_NAME: ${{ inputs.pkg_name }} + shell: bash run: | local WORKSPACE_PATH='' local PROJECT_FILE='' @@ -43,7 +44,7 @@ runs: BUILD_OUTPUT_PATH='pkgs/telemetry/src/bin/Release/' BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.Telemetry.dll' fi - + echo "WORKSPACE_PATH=$WORKSPACE_PATH" >> $GITHUB_ENV echo "PROJECT_FILE=$PROJECT_FILE" >> $GITHUB_ENV echo "TEST_PROJECT_FILE=$TEST_PROJECT_FILE" >> $GITHUB_ENV From feb2a3abe09413ca6d4b13d70eb0e1bf535353c5 Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 16:52:36 -0500 Subject: [PATCH 05/17] fixing setup-env bash and adding missing env variables in server sdk case --- .github/actions/setup-env/action.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index 65bc7610..ee025fe5 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -13,13 +13,13 @@ runs: PACKAGE_NAME: ${{ inputs.pkg_name }} shell: bash run: | - local WORKSPACE_PATH='' - local PROJECT_FILE='' - local BUILD_OUTPUT_PATH='' - local BUILD_OUTPUT_DLL_NAME='' - local TEST_PROJECT_FILE='' - local CONTRACT_TEST_PROJECT_FILE='' - local CONTRACT_TEST_DLL_FILE='' + WORKSPACE_PATH='' + PROJECT_FILE='' + BUILD_OUTPUT_PATH='' + BUILD_OUTPUT_DLL_NAME='' + TEST_PROJECT_FILE='' + CONTRACT_TEST_PROJECT_FILE='' + CONTRACT_TEST_DLL_FILE='' if [[ $PACKAGE_NAME == 'LaunchDarkly.ClientSdk' ]]; then WORKSPACE_PATH='pkgs/sdk/client' @@ -36,6 +36,8 @@ runs: TEST_PROJECT_FILE='pkgs/sdk/server/test/LaunchDarkly.ServerSdk.Tests.csproj' BUILD_OUTPUT_PATH='pkgs/sdk/server/src/bin/Release/' BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.dll' + CONTRACT_TEST_PROJECT_FILE=pkgs/sdk/server/contract-tests/TestService.csproj + CONTRACT_TEST_DLL_FILE=pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk.Telemetry' ]]; then WORKSPACE_PATH='pkgs/telemetry' From 8a9632ab119f6bc30624c147ffdee0bd99c51fec Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 17:03:31 -0500 Subject: [PATCH 06/17] correcting client test project path --- .github/actions/setup-env/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index ee025fe5..1e960e49 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -24,18 +24,18 @@ runs: if [[ $PACKAGE_NAME == 'LaunchDarkly.ClientSdk' ]]; then WORKSPACE_PATH='pkgs/sdk/client' PROJECT_FILE='pkgs/sdk/client/src/LaunchDarkly.ClientSdk.csproj' - TEST_PROJECT_FILE='pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests.csproj' BUILD_OUTPUT_PATH='pkgs/sdk/client/src/LaunchDarkly.ClientSdk/bin/Release/' BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ClientSdk.dll' + TEST_PROJECT_FILE='pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj' CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/client/contract-tests/TestService.csproj' CONTRACT_TEST_DLL_FILE='pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll' elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk' ]]; then 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/' BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.dll' + TEST_PROJECT_FILE='pkgs/sdk/server/test/LaunchDarkly.ServerSdk.Tests.csproj' CONTRACT_TEST_PROJECT_FILE=pkgs/sdk/server/contract-tests/TestService.csproj CONTRACT_TEST_DLL_FILE=pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll From 48644d2bee45b176784e3b49087a425f840ea7ca Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 17:11:36 -0500 Subject: [PATCH 07/17] increasing contract test timeout --- .github/actions/contract-tests/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/contract-tests/action.yml b/.github/actions/contract-tests/action.yml index 9fad6825..761e2056 100644 --- a/.github/actions/contract-tests/action.yml +++ b/.github/actions/contract-tests/action.yml @@ -33,5 +33,5 @@ runs: uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1.0.2 with: test_service_port: 8000 - extra_params: '--status-timeout=120' + extra_params: '--status-timeout=600' token: ${{ inputs.token }} From 826a1b7ab26526824bb6d86952f3ab03a5f543d4 Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 17:26:58 -0500 Subject: [PATCH 08/17] fixing copy pasta in dotnet-client contract test dll path --- .github/actions/setup-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index 1e960e49..7ade87bf 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -28,7 +28,7 @@ runs: BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ClientSdk.dll' TEST_PROJECT_FILE='pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj' CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/client/contract-tests/TestService.csproj' - CONTRACT_TEST_DLL_FILE='pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll' + CONTRACT_TEST_DLL_FILE='pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk' ]]; then WORKSPACE_PATH='pkgs/sdk/server' From 11363cd433a32a24db9430451bba9080e77ecd26 Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Wed, 12 Jun 2024 17:41:11 -0500 Subject: [PATCH 09/17] more fixes --- .github/actions/setup-env/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index 7ade87bf..a040342c 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -28,7 +28,7 @@ runs: BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ClientSdk.dll' TEST_PROJECT_FILE='pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj' CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/client/contract-tests/TestService.csproj' - CONTRACT_TEST_DLL_FILE='pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll + CONTRACT_TEST_DLL_FILE='pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll' elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk' ]]; then WORKSPACE_PATH='pkgs/sdk/server' @@ -36,8 +36,8 @@ runs: BUILD_OUTPUT_PATH='pkgs/sdk/server/src/bin/Release/' BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.dll' TEST_PROJECT_FILE='pkgs/sdk/server/test/LaunchDarkly.ServerSdk.Tests.csproj' - CONTRACT_TEST_PROJECT_FILE=pkgs/sdk/server/contract-tests/TestService.csproj - CONTRACT_TEST_DLL_FILE=pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll + CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/server/contract-tests/TestService.csproj' + CONTRACT_TEST_DLL_FILE='pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll' elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk.Telemetry' ]]; then WORKSPACE_PATH='pkgs/telemetry' From 0e98150856e9e7113fd5ac98bb9014373f58ea51 Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Thu, 13 Jun 2024 10:09:21 -0500 Subject: [PATCH 10/17] fixing env export --- .github/actions/contract-tests/action.yml | 2 +- .github/actions/setup-env/action.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/contract-tests/action.yml b/.github/actions/contract-tests/action.yml index 761e2056..9fad6825 100644 --- a/.github/actions/contract-tests/action.yml +++ b/.github/actions/contract-tests/action.yml @@ -33,5 +33,5 @@ runs: uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1.0.2 with: test_service_port: 8000 - extra_params: '--status-timeout=600' + extra_params: '--status-timeout=120' token: ${{ inputs.token }} diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index a040342c..62ce5bdf 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -49,8 +49,8 @@ runs: echo "WORKSPACE_PATH=$WORKSPACE_PATH" >> $GITHUB_ENV echo "PROJECT_FILE=$PROJECT_FILE" >> $GITHUB_ENV - echo "TEST_PROJECT_FILE=$TEST_PROJECT_FILE" >> $GITHUB_ENV echo "BUILD_OUTPUT_PATH=$BUILD_OUTPUT_PATH" >> $GITHUB_ENV echo "BUILD_OUTPUT_DLL_NAME=$BUILD_OUTPUT_DLL_NAME" >> $GITHUB_ENV + echo "TEST_PROJECT_FILE=$TEST_PROJECT_FILE" >> $GITHUB_ENV echo "CONTRACT_TEST_PROJECT_FILE=$CONTRACT_TEST_PROJECT_FILE" >> $GITHUB_ENV - echo "CONTRACT_TEST_DLL_NAME=$CONTRACT_TEST_DLL_NAME" >> $GITHUB_ENV + echo "CONTRACT_TEST_DLL_FILE=$CONTRACT_TEST_DLL_FILE" >> $GITHUB_ENV From d8ad24eab2eb962cef2055214a41cb8a1684e06a Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Thu, 13 Jun 2024 10:19:01 -0500 Subject: [PATCH 11/17] reintroducing ubuntu and windows runners for server sdk and server telemetry --- .github/workflows/sdk-server-ci.yml | 2 +- .github/workflows/telemetry-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sdk-server-ci.yml b/.github/workflows/sdk-server-ci.yml index 21522457..9f91e5c7 100644 --- a/.github/workflows/sdk-server-ci.yml +++ b/.github/workflows/sdk-server-ci.yml @@ -13,7 +13,7 @@ jobs: build-and-test: strategy: matrix: - os: [macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] fail-fast: false runs-on: ${{ matrix.os }} permissions: diff --git a/.github/workflows/telemetry-ci.yml b/.github/workflows/telemetry-ci.yml index 3354efdd..92a8e623 100644 --- a/.github/workflows/telemetry-ci.yml +++ b/.github/workflows/telemetry-ci.yml @@ -13,7 +13,7 @@ jobs: build-and-test: strategy: matrix: - os: [macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] fail-fast: false runs-on: ${{ matrix.os }} permissions: From b3c606ca809ccfe79159472c9ecf87148df8184a Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Thu, 13 Jun 2024 11:11:34 -0500 Subject: [PATCH 12/17] first attempt at package github_actions.env file --- .github/workflows/sdk-client-ci.yml | 6 +++--- pkgs/sdk/client/github_actions.env | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 pkgs/sdk/client/github_actions.env diff --git a/.github/workflows/sdk-client-ci.yml b/.github/workflows/sdk-client-ci.yml index 5edeebff..7864d89c 100644 --- a/.github/workflows/sdk-client-ci.yml +++ b/.github/workflows/sdk-client-ci.yml @@ -22,9 +22,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-env - with: - pkg_name: LaunchDarkly.ClientSdk + - name: Setup Env from project's Env file + shell: bash + run: set -o allexport && source pkgs/sdk/client/github_actions.env && set +o allexport - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 name: Get secrets diff --git a/pkgs/sdk/client/github_actions.env b/pkgs/sdk/client/github_actions.env new file mode 100644 index 00000000..72dfdebe --- /dev/null +++ b/pkgs/sdk/client/github_actions.env @@ -0,0 +1,9 @@ +# This file contains environment variables used by Github Actions in various workflows + +WORKSPACE_PATH='pkgs/sdk/client' +PROJECT_FILE='pkgs/sdk/client/src/LaunchDarkly.ClientSdk.csproj' +BUILD_OUTPUT_PATH='pkgs/sdk/client/src/LaunchDarkly.ClientSdk/bin/Release/' +BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ClientSdk.dll' +TEST_PROJECT_FILE='pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj' +CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/client/contract-tests/TestService.csproj' +CONTRACT_TEST_DLL_FILE='pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll' \ No newline at end of file From 29c581910106b99b1d4e605f83d8a016ee9e224d Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Thu, 13 Jun 2024 11:21:25 -0500 Subject: [PATCH 13/17] adds github_actions.env for server and telemetry packages --- .github/actions/contract-tests/action.yml | 2 +- .github/actions/setup-env/action.yml | 56 ----------------------- .github/workflows/sdk-server-ci.yml | 6 +-- .github/workflows/telemetry-ci.yml | 6 +-- pkgs/sdk/server/github_actions.env | 9 ++++ pkgs/telemetry/github_actions.env | 7 +++ 6 files changed, 23 insertions(+), 63 deletions(-) delete mode 100644 .github/actions/setup-env/action.yml create mode 100644 pkgs/sdk/server/github_actions.env create mode 100644 pkgs/telemetry/github_actions.env diff --git a/.github/actions/contract-tests/action.yml b/.github/actions/contract-tests/action.yml index 9fad6825..2eae46da 100644 --- a/.github/actions/contract-tests/action.yml +++ b/.github/actions/contract-tests/action.yml @@ -33,5 +33,5 @@ runs: uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1.0.2 with: test_service_port: 8000 - extra_params: '--status-timeout=120' + extra_params: '--status-timeout=360' token: ${{ inputs.token }} diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml deleted file mode 100644 index 62ce5bdf..00000000 --- a/.github/actions/setup-env/action.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Setup Package Environment -description: Based on the provided package name, this action will map and set up the necessary environment variables -inputs: - pkg_name: - description: 'The package this will setup the environment for' - required: true - -runs: - using: composite - steps: - - name: Setup env variables based on pkg_name - env: - PACKAGE_NAME: ${{ inputs.pkg_name }} - shell: bash - run: | - WORKSPACE_PATH='' - PROJECT_FILE='' - BUILD_OUTPUT_PATH='' - BUILD_OUTPUT_DLL_NAME='' - TEST_PROJECT_FILE='' - CONTRACT_TEST_PROJECT_FILE='' - CONTRACT_TEST_DLL_FILE='' - - if [[ $PACKAGE_NAME == 'LaunchDarkly.ClientSdk' ]]; then - WORKSPACE_PATH='pkgs/sdk/client' - PROJECT_FILE='pkgs/sdk/client/src/LaunchDarkly.ClientSdk.csproj' - BUILD_OUTPUT_PATH='pkgs/sdk/client/src/LaunchDarkly.ClientSdk/bin/Release/' - BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ClientSdk.dll' - TEST_PROJECT_FILE='pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj' - CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/client/contract-tests/TestService.csproj' - CONTRACT_TEST_DLL_FILE='pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll' - - elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk' ]]; then - WORKSPACE_PATH='pkgs/sdk/server' - PROJECT_FILE='pkgs/sdk/server/src/LaunchDarkly.ServerSdk.csproj' - BUILD_OUTPUT_PATH='pkgs/sdk/server/src/bin/Release/' - BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.dll' - TEST_PROJECT_FILE='pkgs/sdk/server/test/LaunchDarkly.ServerSdk.Tests.csproj' - CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/server/contract-tests/TestService.csproj' - CONTRACT_TEST_DLL_FILE='pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll' - - elif [[ $PACKAGE_NAME == 'LaunchDarkly.ServerSdk.Telemetry' ]]; then - 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/' - BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.Telemetry.dll' - fi - - echo "WORKSPACE_PATH=$WORKSPACE_PATH" >> $GITHUB_ENV - echo "PROJECT_FILE=$PROJECT_FILE" >> $GITHUB_ENV - echo "BUILD_OUTPUT_PATH=$BUILD_OUTPUT_PATH" >> $GITHUB_ENV - echo "BUILD_OUTPUT_DLL_NAME=$BUILD_OUTPUT_DLL_NAME" >> $GITHUB_ENV - echo "TEST_PROJECT_FILE=$TEST_PROJECT_FILE" >> $GITHUB_ENV - echo "CONTRACT_TEST_PROJECT_FILE=$CONTRACT_TEST_PROJECT_FILE" >> $GITHUB_ENV - echo "CONTRACT_TEST_DLL_FILE=$CONTRACT_TEST_DLL_FILE" >> $GITHUB_ENV diff --git a/.github/workflows/sdk-server-ci.yml b/.github/workflows/sdk-server-ci.yml index 9f91e5c7..21a299e8 100644 --- a/.github/workflows/sdk-server-ci.yml +++ b/.github/workflows/sdk-server-ci.yml @@ -22,9 +22,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-env - with: - pkg_name: LaunchDarkly.ServerSdk + - name: Setup Env from project's Env file + shell: bash + run: set -o allexport && source pkgs/sdk/server/github_actions.env && set +o allexport - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 name: Get secrets diff --git a/.github/workflows/telemetry-ci.yml b/.github/workflows/telemetry-ci.yml index 92a8e623..dcbc5a8d 100644 --- a/.github/workflows/telemetry-ci.yml +++ b/.github/workflows/telemetry-ci.yml @@ -22,9 +22,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-env - with: - pkg_name: LaunchDarkly.ServerSdk + - name: Setup Env from project's Env file + shell: bash + run: set -o allexport && source pkgs/telemetry/github_actions.env && set +o allexport - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 name: Get secrets diff --git a/pkgs/sdk/server/github_actions.env b/pkgs/sdk/server/github_actions.env new file mode 100644 index 00000000..42d3db0b --- /dev/null +++ b/pkgs/sdk/server/github_actions.env @@ -0,0 +1,9 @@ +# This file contains environment variables used by Github Actions in various workflows + +WORKSPACE_PATH='pkgs/sdk/server' +PROJECT_FILE='pkgs/sdk/server/src/LaunchDarkly.ServerSdk.csproj' +BUILD_OUTPUT_PATH='pkgs/sdk/server/src/bin/Release/' +BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.dll' +TEST_PROJECT_FILE='pkgs/sdk/server/test/LaunchDarkly.ServerSdk.Tests.csproj' +CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/server/contract-tests/TestService.csproj' +CONTRACT_TEST_DLL_FILE='pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll' \ No newline at end of file diff --git a/pkgs/telemetry/github_actions.env b/pkgs/telemetry/github_actions.env new file mode 100644 index 00000000..7184fb86 --- /dev/null +++ b/pkgs/telemetry/github_actions.env @@ -0,0 +1,7 @@ +# This file contains environment variables used by Github Actions in various workflows + +WORKSPACE_PATH='pkgs/telemetry' +PROJECT_FILE='pkgs/telemetry/src/LaunchDarkly.ServerSdk.Telemetry.csproj' +BUILD_OUTPUT_PATH='pkgs/telemetry/src/bin/Release/' +BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ServerSdk.Telemetry.dll' +TEST_PROJECT_FILE='pkgs/telemetry/test/LaunchDarkly.ServerSdk.Telemetry.Tests.csproj' \ No newline at end of file From 281db4484734a72f409f14eb4401e065f4c98501 Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Thu, 13 Jun 2024 13:32:13 -0500 Subject: [PATCH 14/17] testing solution --- .github/workflows/sdk-client-ci.yml | 2 +- pkgs/sdk/client/github_actions.env | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sdk-client-ci.yml b/.github/workflows/sdk-client-ci.yml index 7864d89c..9320ec66 100644 --- a/.github/workflows/sdk-client-ci.yml +++ b/.github/workflows/sdk-client-ci.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Env from project's Env file shell: bash - run: set -o allexport && source pkgs/sdk/client/github_actions.env && set +o allexport + run: echo "$(cat pkgs/sdk/client/github_actions.env)" >> $GITHUB_ENV - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 name: Get secrets diff --git a/pkgs/sdk/client/github_actions.env b/pkgs/sdk/client/github_actions.env index 72dfdebe..44dbcb33 100644 --- a/pkgs/sdk/client/github_actions.env +++ b/pkgs/sdk/client/github_actions.env @@ -1,9 +1,7 @@ -# This file contains environment variables used by Github Actions in various workflows - WORKSPACE_PATH='pkgs/sdk/client' PROJECT_FILE='pkgs/sdk/client/src/LaunchDarkly.ClientSdk.csproj' BUILD_OUTPUT_PATH='pkgs/sdk/client/src/LaunchDarkly.ClientSdk/bin/Release/' BUILD_OUTPUT_DLL_NAME='LaunchDarkly.ClientSdk.dll' TEST_PROJECT_FILE='pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj' CONTRACT_TEST_PROJECT_FILE='pkgs/sdk/client/contract-tests/TestService.csproj' -CONTRACT_TEST_DLL_FILE='pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll' \ No newline at end of file +CONTRACT_TEST_DLL_FILE='pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll' From d9758de1aabc15d8f973914cd51188eff074067e Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Thu, 13 Jun 2024 13:43:04 -0500 Subject: [PATCH 15/17] fixing server and telemetry env read code --- .github/workflows/sdk-server-ci.yml | 2 +- .github/workflows/telemetry-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sdk-server-ci.yml b/.github/workflows/sdk-server-ci.yml index 21a299e8..4fddae42 100644 --- a/.github/workflows/sdk-server-ci.yml +++ b/.github/workflows/sdk-server-ci.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Env from project's Env file shell: bash - run: set -o allexport && source pkgs/sdk/server/github_actions.env && set +o allexport + run: echo "$(cat pkgs/sdk/server/github_actions.env)" >> $GITHUB_ENV - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 name: Get secrets diff --git a/.github/workflows/telemetry-ci.yml b/.github/workflows/telemetry-ci.yml index dcbc5a8d..00c2eb19 100644 --- a/.github/workflows/telemetry-ci.yml +++ b/.github/workflows/telemetry-ci.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Env from project's Env file shell: bash - run: set -o allexport && source pkgs/telemetry/github_actions.env && set +o allexport + run: echo "$(cat pkgs/telemetry/github_actions.env)" >> $GITHUB_ENV - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 name: Get secrets From 2d109b6a679cb518f6b74ea9403850584e453bc7 Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Thu, 13 Jun 2024 13:45:21 -0500 Subject: [PATCH 16/17] fixing server and telemetry env read code --- pkgs/sdk/server/github_actions.env | 2 -- pkgs/telemetry/github_actions.env | 2 -- 2 files changed, 4 deletions(-) diff --git a/pkgs/sdk/server/github_actions.env b/pkgs/sdk/server/github_actions.env index 42d3db0b..f1dc57de 100644 --- a/pkgs/sdk/server/github_actions.env +++ b/pkgs/sdk/server/github_actions.env @@ -1,5 +1,3 @@ -# This file contains environment variables used by Github Actions in various workflows - WORKSPACE_PATH='pkgs/sdk/server' PROJECT_FILE='pkgs/sdk/server/src/LaunchDarkly.ServerSdk.csproj' BUILD_OUTPUT_PATH='pkgs/sdk/server/src/bin/Release/' diff --git a/pkgs/telemetry/github_actions.env b/pkgs/telemetry/github_actions.env index 7184fb86..e8937a46 100644 --- a/pkgs/telemetry/github_actions.env +++ b/pkgs/telemetry/github_actions.env @@ -1,5 +1,3 @@ -# This file contains environment variables used by Github Actions in various workflows - WORKSPACE_PATH='pkgs/telemetry' PROJECT_FILE='pkgs/telemetry/src/LaunchDarkly.ServerSdk.Telemetry.csproj' BUILD_OUTPUT_PATH='pkgs/telemetry/src/bin/Release/' From f3e4b793f6a4e286ae499ff2ac8b52b3d3c9985b Mon Sep 17 00:00:00 2001 From: Todd Anderson Date: Thu, 13 Jun 2024 14:14:05 -0500 Subject: [PATCH 17/17] Fixing other usages of setup-env, switching from package name as parameter to package workspace --- .github/workflows/manual-publish.yml | 16 ++++++++-------- .github/workflows/publish-docs.yml | 14 +++++++------- .github/workflows/release-please.yml | 20 +++++++++++--------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index 714b7ab3..a1aad17b 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -2,14 +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 - - LaunchDarkly.ClientSdk + - 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 @@ -33,9 +33,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-env - with: - pkg_name: ${{ inputs.pkg_name }} + - 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: full-release @@ -61,4 +61,4 @@ jobs: with: base64-subjects: "${{ needs.build.outputs.full-release-hashes }}" upload-assets: true - provenance-name: ${{inputs.pkg_name}}_provenance.intoto.jsonl + provenance-name: ${{inputs.pkg_workspace}}_provenance.intoto.jsonl diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 61ac5d28..b9b5ca22 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -1,14 +1,14 @@ on: workflow_dispatch: inputs: - pkg_name: + pkg_workspace: description: 'The package to publish' required: true type: choice options: - - LaunchDarkly.ClientSdk - - LaunchDarkly.ServerSdk - - LaunchDarkly.ServerSdk.Telemetry + - pkgs/sdk/client + - pkgs/sdk/server + - pkgs/telemetry name: Publish Docs jobs: @@ -19,9 +19,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-env - with: - pkg_name: ${{ inputs.pkg_name }} + - 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 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 77599b3f..8d4404f9 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -38,9 +38,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-env - with: - pkg_name: LaunchDarkly.ServerSdk + - 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 @@ -66,9 +66,10 @@ jobs: hashes: ${{ steps.full-release.outputs.hashes }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-env - with: - pkg_name: LaunchDarkly.ServerSdk.Telemetry + + - 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 @@ -94,9 +95,10 @@ jobs: hashes: ${{ steps.full-release.outputs.hashes }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-env - with: - pkg_name: LaunchDarkly.ClientSdk + + - 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