Create MacOS app bundle via a project target (#1376)

This commit is contained in:
Oleksii Holub
2025-05-11 01:29:55 +03:00
committed by GitHub
parent 59d803d9f1
commit b56c7db3ec
4 changed files with 99 additions and 87 deletions

View File

@@ -133,21 +133,12 @@ jobs:
dotnet publish ${{ matrix.app }}
-p:Version=${{ github.ref_type == 'tag' && github.ref_name || format('999.9.9-ci-{0}', github.sha) }}
-p:CSharpier_Bypass=true
-p:PublishMacOSBundle=${{ startsWith(matrix.rid, 'osx-') }}
--output ${{ matrix.app }}/bin/publish/
--configuration Release
--runtime ${{ matrix.rid }}
--self-contained
- name: Generate macOS .app bundle resources
if: ${{ startsWith(matrix.rid, 'osx-') && matrix.app == 'DiscordChatExporter.Gui' }}
shell: pwsh
run: >
./bundle-macos-app.ps1
-BundleName "${{ matrix.asset }}"
-PublishDir "${{ matrix.app }}/bin/publish/"
-Version "${{ github.ref_type == 'tag' && github.ref_name || '999.9.9'}}"
-GitHubSha "${{ github.sha }}"
- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
@@ -220,12 +211,15 @@ jobs:
path: ${{ matrix.app }}/
- name: Set permissions
if: ${{ !startsWith(matrix.rid, 'win-') && !(startsWith(matrix.rid, 'osx-') && matrix.app == 'DiscordChatExporter.Gui') }}
run: chmod +x ${{ matrix.app }}/${{ matrix.asset }}
- name: Set permissions for macOS .app bundle
if: ${{ startsWith(matrix.rid, 'osx-') && matrix.app == 'DiscordChatExporter.Gui' }}
run: chmod +x ${{ matrix.app }}/${{ matrix.asset }}.app/Contents/MacOS/${{ matrix.asset }}
if: ${{ !startsWith(matrix.rid, 'win-') }}
run: |
if [ -f ${{ matrix.app }}/${{ matrix.asset }} ]; then
chmod +x ${{ matrix.app }}/${{ matrix.asset }}
fi
if [ -f ${{ matrix.app }}/${{ matrix.asset }}.app/Contents/MacOS/${{ matrix.asset }} ]; then
chmod +x ${{ matrix.app }}/${{ matrix.asset }}.app/Contents/MacOS/${{ matrix.asset }}
fi
- name: Create package
# Change into the artifacts directory to avoid including the directory itself in the zip archive