Skip to content

Commit e6c1479

Browse files
macOS: Rename DMG file
- Rename DMG file to indicate whether it is notarized or not - Unsigned DMG is still only released as artifact - Don't accidentally release unsigned binaries to end users
1 parent 9e21a1b commit e6c1479

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/cicd_macos.yaml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
PROGRAM_NAME_WITH_PATH: 'enduser/trackereditor'
2222
BUILD_WITH_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
2323
PROJECT_LPI: source/project/tracker_editor/trackereditor.lpi
24-
RELEASE_DMG_FILE: trackereditor_macOS_universal.dmg
24+
RELEASE_DMG_FILE: trackereditor_macOS_notarized_universal_binary.dmg
2525

2626
steps:
2727
- uses: actions/checkout@v4
@@ -37,26 +37,22 @@ jobs:
3737
- name: Build trackereditor app for Apple silicon (aarch64)
3838
run: |
3939
${{ env.LAZBUILD_WITH_PATH }} --build-all --build-mode=Release --widgetset=cocoa --cpu=aarch64 ${{ env.PROJECT_LPI }}
40-
cp -a ${{ env.PROGRAM_NAME_WITH_PATH }} ${{ env.PROGRAM_NAME_WITH_PATH }}-aarch64
40+
mv ${{ env.PROGRAM_NAME_WITH_PATH }} ${{ env.PROGRAM_NAME_WITH_PATH }}-aarch64
4141
shell: bash
4242

4343
- name: Build trackereditor app for Intel Mac version (x86_64)
4444
run: |
4545
${{ env.LAZBUILD_WITH_PATH }} --build-all --build-mode=Release --widgetset=cocoa --cpu=x86_64 ${{ env.PROJECT_LPI }}
46-
cp -a ${{ env.PROGRAM_NAME_WITH_PATH }} ${{ env.PROGRAM_NAME_WITH_PATH }}-x86_64
46+
mv ${{ env.PROGRAM_NAME_WITH_PATH }} ${{ env.PROGRAM_NAME_WITH_PATH }}-x86_64
4747
shell: bash
4848

4949
- name: Create a Universal macOS binary from aarch64 and x86_64
5050
run: |
51-
# remove the previeus binary build
52-
rm -f ${{ env.PROGRAM_NAME_WITH_PATH }}
53-
5451
# Create a new Universal macOS binary
5552
lipo -create -output ${{ env.PROGRAM_NAME_WITH_PATH }} ${{ env.PROGRAM_NAME_WITH_PATH }}-aarch64 ${{ env.PROGRAM_NAME_WITH_PATH }}-x86_64
5653
57-
# Remove this single binary build. Not needed any more.
58-
rm -f ${{ env.PROGRAM_NAME_WITH_PATH }}-aarch64
59-
rm -f ${{ env.PROGRAM_NAME_WITH_PATH }}-x86_64
54+
# Remove these extra binary build. Not needed any more.
55+
rm -f ${{ env.PROGRAM_NAME_WITH_PATH }}-*
6056
shell: bash
6157

6258
- name: Extract latest program version from metainfo and update the Info.plist with it
@@ -200,16 +196,21 @@ jobs:
200196
xcrun stapler staple "${{ env.RELEASE_DMG_FILE }}"
201197
shell: bash
202198

203-
- name: Upload Artifact
199+
- name: Use diferent .dmg file name for non signed/notarize version
200+
if: ${{ env.BUILD_WITH_CERTIFICATE == '' }}
201+
run: mv ${{ env.RELEASE_DMG_FILE }} trackereditor_macOS_UNSIGNED_universal_binary.dmg
202+
shell: bash
203+
204+
- name: Upload Artifact. Signed/Notarize is optional.
204205
uses: actions/upload-artifact@v4
205206
with:
206-
name: artifact-${{ env.RELEASE_DMG_FILE }}
207-
path: ${{ env.RELEASE_DMG_FILE }}
207+
name: artifact-${{ runner.os }}
208+
path: "*.dmg"
208209
compression-level: 0 # no compression. Content is already a zip file
209210
if-no-files-found: error
210211

211-
- name: File release to end user
212+
- name: Notarize file release to end user. If certificate is present.
212213
uses: softprops/action-gh-release@v2
213-
if: startsWith(github.ref, 'refs/tags/')
214+
if: startsWith(github.ref, 'refs/tags/') && (env.BUILD_WITH_CERTIFICATE != '')
214215
with:
215216
files: ${{ env.RELEASE_DMG_FILE }}

0 commit comments

Comments
 (0)