-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmanual-sdk-release-artifacts.yml
More file actions
110 lines (105 loc) · 4.26 KB
/
manual-sdk-release-artifacts.yml
File metadata and controls
110 lines (105 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Checks out the tag, builds release builds, and attaches them to the release for the tag.
# If you need to change build scripts, then update the tag to include the modifications.
# NOTE: This workflow uses sdk-release/action.yml @ the tag specified in the workflow_dispatch input.
on:
workflow_dispatch:
inputs:
tag:
description: 'The tag to create release artifacts for.'
required: true
sdk_target:
description: 'The library/cmake target to release (delimited by ":").'
required: true
default: 'libs/client-sdk:launchdarkly-cpp-client'
type: choice
options:
- libs/client-sdk:launchdarkly-cpp-client
- libs/server-sdk:launchdarkly-cpp-server
- libs/server-sdk-redis-source:launchdarkly-cpp-server-redis-source
name: Publish SDK Artifacts
jobs:
split-input:
runs-on: ubuntu-22.04
outputs:
sdk_path: ${{ steps.split-string.outputs.SDK_PATH }}
sdk_cmake_target: ${{ steps.split-string.outputs.SDK_CMAKE_TARGET }}
steps:
- name: Determine CMake target and SDK library path
id: split-string
run: |
INPUT="${{ inputs.sdk_target }}"
IFS=':' read -ra PATH_AND_TARGET <<< "$INPUT"
echo "SDK_PATH=${PATH_AND_TARGET[0]}" >> $GITHUB_OUTPUT
echo "SDK_CMAKE_TARGET=${PATH_AND_TARGET[1]}" >> $GITHUB_OUTPUT
release-sdk:
needs: split-input
strategy:
matrix:
# Each of the platforms for which release-artifacts need generated.
os: [ ubuntu-22.04, windows-2022, macos-15-large ]
runs-on: ${{ matrix.os }}
outputs:
hashes-linux: ${{ steps.release-sdk.outputs.hashes-linux }}
hashes-windows: ${{ steps.release-sdk.outputs.hashes-windows }}
hashes-macos: ${{ steps.release-sdk.outputs.hashes-macos }}
steps:
# https://github.com/actions/checkout/releases/tag/v4.3.0
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
with:
ref: ${{ inputs.tag }}
- id: release-sdk
name: Full release of ${{ needs.split-input.outputs.sdk_path }}
uses: ./.github/actions/sdk-release
with:
# The tag of the release to upload artifacts to.
tag_name: ${{ inputs.tag }}
github_token: ${{secrets.GITHUB_TOKEN}}
sdk_path: ${{ needs.split-input.outputs.sdk_path}}
sdk_cmake_target: ${{ needs.split-input.outputs.sdk_cmake_target}}
release-sdk-mac-arm64:
needs: split-input
runs-on: macos-15
outputs:
hashes-macos-arm64: ${{ steps.release-sdk.outputs.hashes-macos }}
steps:
# https://github.com/actions/checkout/releases/tag/v4.3.0
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
with:
ref: ${{ inputs.tag }}
- id: release-sdk
name: Full release of ${{ needs.split-input.outputs.sdk_path }} (macOS arm64)
uses: ./.github/actions/sdk-release
with:
tag_name: ${{ inputs.tag }}
github_token: ${{secrets.GITHUB_TOKEN}}
sdk_path: ${{ needs.split-input.outputs.sdk_path}}
sdk_cmake_target: ${{ needs.split-input.outputs.sdk_cmake_target}}
mac_artifact_arch: 'arm64'
release-sdk-provenance:
needs: [ 'release-sdk' ]
strategy:
matrix:
# Generates a combined attestation for each platform
os: [ linux, windows, macos ]
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
with:
base64-subjects: "${{ needs.release-sdk.outputs[format('hashes-{0}', matrix.os)] }}"
upload-assets: true
upload-tag-name: ${{ inputs.tag }}
provenance-name: ${{ format('{0}-multiple-provenance.intoto.jsonl', matrix.os) }}
release-sdk-mac-arm64-provenance:
needs: [ 'release-sdk-mac-arm64' ]
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
with:
base64-subjects: "${{ needs.release-sdk-mac-arm64.outputs.hashes-macos-arm64 }}"
upload-assets: true
upload-tag-name: ${{ inputs.tag }}
provenance-name: 'macos-arm64-multiple-provenance.intoto.jsonl'