|
| 1 | +# Checks out the tag, builds release builds, and attaches them to the release for the tag. |
| 2 | +# If you need to change build scripts, then update the tag to include the modifications. |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + tag: |
| 7 | + description: 'The tag to create release artifacts for.' |
| 8 | + required: true |
| 9 | + sdk_target: |
| 10 | + description: 'The library/cmake target to release (delimited by ":").' |
| 11 | + required: true |
| 12 | + default: 'libs/client-sdk:launchdarkly-cpp-client' |
| 13 | + type: choice |
| 14 | + options: |
| 15 | + - libs/client-sdk:launchdarkly-cpp-client |
| 16 | + |
| 17 | +name: Publish SDK Artifacts |
| 18 | + |
| 19 | +jobs: |
| 20 | + split-input: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - name: Determine CMake target and SDK library path |
| 24 | + run: | |
| 25 | + INPUT="${{ inputs.sdk_target }}" |
| 26 | + IFS=':' read -ra PATH_AND_TARGET <<< "$INPUT" |
| 27 | + echo "SDK_PATH=${PATH_AND_TARGET[0]}" >> $GITHUB_OUTPUT |
| 28 | + echo "SDK_CMAKE_TARGET=${PATH_AND_TARGET[1]}" >> $GITHUB_OUTPUT |
| 29 | + release-sdk: |
| 30 | + needs: split-input |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + # Each of the platforms for which release-artifacts need generated. |
| 34 | + os: [ ubuntu-latest, windows-2022, macos-12 ] |
| 35 | + runs-on: ${{ matrix.os }} |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v3 |
| 38 | + with: |
| 39 | + ref: ${{ inputs.tag }} |
| 40 | + - id: release-sdk |
| 41 | + name: Full release of ${{ needs.split-input.outputs.SDK_PATH }} |
| 42 | + uses: ./.github/actions/sdk-release |
| 43 | + with: |
| 44 | + # The tag of the release to upload artifacts to. |
| 45 | + tag_name: ${{ inputs.tag }} |
| 46 | + github_token: ${{secrets.GITHUB_TOKEN}} |
| 47 | + sdk_path: ${{ needs.split-input.outputs.SDK_PATH }} |
| 48 | + sdk_cmake_target: ${{ needs.split-input.outputs.SDK_CMAKE_TARGET }} |
0 commit comments