27
27
name : Release
28
28
runs-on : ubuntu-20.04
29
29
timeout-minutes : 30
30
+ outputs :
31
+ # Used by the release-osx-arm64 job to upload the osx-arm64 binary
32
+ release_upload_url : ${{ steps.create_release.outputs.upload_url }}
30
33
steps :
31
34
32
35
45
48
REPO=cyclonedx/cyclonedx-cli
46
49
dotnet build --configuration Release
47
50
mkdir bin
48
- for runtime in linux-x64 linux-musl-x64 linux-arm linux-arm64 win-x64 win-x86 win-arm win-arm64 osx-x64 osx-arm64
51
+ for runtime in linux-x64 linux-musl-x64 linux-arm linux-arm64 win-x64 win-x86 win-arm win-arm64 osx-x64
49
52
do
50
53
dotnet publish src/cyclonedx/cyclonedx.csproj -r $runtime --configuration Release /p:Version=$VERSION --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --output bin/$runtime
51
54
done
@@ -161,12 +164,38 @@ jobs:
161
164
asset_name : cyclonedx-osx-x64
162
165
asset_content_type : application/octet-stream
163
166
167
+ # Binaries for Apple silicon must be signed, which can only be achieved on macOS.
168
+ # See https://github.com/dotnet/runtime/issues/49091#issuecomment-797029172
169
+ release-osx-arm64 :
170
+ name : Release osx-arm64
171
+ needs : release
172
+ runs-on : macos-latest
173
+ timeout-minutes : 30
174
+ steps :
175
+
176
+
177
+ with :
178
+ dotnet-version : ' 6.0'
179
+
180
+ - name : Create binary
181
+ run : |
182
+ VERSION=`cat semver.txt`
183
+ echo "##[set-output name=version;]$VERSION"
184
+ dotnet build --configuration Release
185
+ mkdir bin
186
+ dotnet publish src/cyclonedx/cyclonedx.csproj -r osx-arm64 --configuration Release /p:Version=$VERSION --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --output bin/osx-arm64
187
+
188
+ # It is enough to "ad-hoc" sign the binary, we don't need a valid developer certificate for now.
189
+ - name : Sign binary
190
+ run : |
191
+ codesign -f -s - bin/osx-arm64/cyclonedx
192
+
164
193
- name : Upload binary to github release
165
194
166
195
env :
167
196
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168
197
with :
169
- upload_url : ${{ steps.create_release .outputs.upload_url }}
198
+ upload_url : ${{ needs.release .outputs.release_upload_url }}
170
199
asset_path : bin/osx-arm64/cyclonedx
171
200
asset_name : cyclonedx-osx-arm64
172
- asset_content_type : application/octet-stream
201
+ asset_content_type : application/octet-stream
0 commit comments