mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-09 11:51:59 -04:00
Bundle on pack instead of deploy
This commit is contained in:
parent
56d47efab8
commit
4d9bd4afe4
1 changed files with 50 additions and 56 deletions
106
.github/workflows/main.yml
vendored
106
.github/workflows/main.yml
vendored
|
@ -138,42 +138,62 @@ jobs:
|
|||
--runtime ${{ matrix.rid }}
|
||||
--self-contained
|
||||
|
||||
- name: Set permissions
|
||||
if: ${{ !startsWith(matrix.rid, 'win-') }}
|
||||
run: chmod +x ${{ matrix.app }}/bin/publish/${{ matrix.asset }}
|
||||
|
||||
- name: Generate macOS .app bundle resources
|
||||
if: matrix.app == 'DiscordChatExporter.Gui' && startsWith(matrix.rid, 'osx-')
|
||||
run: |
|
||||
STAGING_DIR="app-bundle-staging"
|
||||
APP_NAME="${{ matrix.asset }}.app"
|
||||
APP_DIR="$STAGING_DIR/$APP_NAME"
|
||||
CONTENTS_DIR="$APP_DIR/Contents"
|
||||
MACOS_DIR="$CONTENTS_DIR/MacOS"
|
||||
RESOURCES_DIR="$CONTENTS_DIR/Resources"
|
||||
PUBLISH_DIR="${{ matrix.app }}/bin/publish"
|
||||
|
||||
# Create directory structure for macOS app bundle
|
||||
mkdir -p "$MACOS_DIR" "$RESOURCES_DIR"
|
||||
|
||||
# Move icon to the .app/Resources directory
|
||||
mv "favicon.icns" "$RESOURCES_DIR/${{ matrix.asset }}.icns"
|
||||
|
||||
# Create the Information Property List file
|
||||
# This file will be used in the .app bundle generated on the deploy job
|
||||
cat > ${{ matrix.app }}/bin/publish/Info.plist << EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>DiscordChatExporter</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© Oleksii Holub</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.Tyrrrz.${{ matrix.asset }}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${{ matrix.asset }}</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${{ matrix.asset }}</string>
|
||||
<key>CFBundleSpokenName</key>
|
||||
<string>Discord Chat Exporter</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${{ github.sha }}</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${{ github.ref_type == 'tag' && github.ref_name || '999.9.9-ci' }}</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
</dict>
|
||||
</plist>
|
||||
cat > $CONTENTS_DIR/Info.plist << EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>DiscordChatExporter</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© Oleksii Holub</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.Tyrrrz.${{ matrix.asset }}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${{ matrix.asset }}</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${{ matrix.asset }}</string>
|
||||
<key>CFBundleSpokenName</key>
|
||||
<string>Discord Chat Exporter</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${{ github.sha }}</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${{ github.ref_type == 'tag' && github.ref_name || '999.9.9-ci' }}</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
# This icon will be used in the .app bundle generated on the deploy job
|
||||
mv favicon.icns ${{ matrix.app }}/bin/publish/DiscordChatExporter.icns
|
||||
# Move all remaining files to the MacOS directory
|
||||
find "$PUBLISH_DIR" -maxdepth 1 -mindepth 1 -exec mv "{}" "$MACOS_DIR/" \;
|
||||
|
||||
# Move final .app bundle to the publish directory
|
||||
mv "$APP_DIR" "$PUBLISH_DIR"
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
|
@ -246,32 +266,6 @@ jobs:
|
|||
name: ${{ matrix.asset }}.${{ matrix.rid }}
|
||||
path: ${{ matrix.app }}/
|
||||
|
||||
- name: Set permissions
|
||||
if: ${{ !startsWith(matrix.rid, 'win-') }}
|
||||
run: chmod +x ${{ matrix.app }}/${{ matrix.asset }}
|
||||
|
||||
- name: Create macOS .app bundle
|
||||
if: matrix.app == 'DiscordChatExporter.Gui' && startsWith(matrix.rid, 'osx-')
|
||||
run: |
|
||||
STAGING_DIR="app-bundle-staging"
|
||||
APP_NAME="${{ matrix.asset }}.app"
|
||||
APP_DIR="$STAGING_DIR/$APP_NAME"
|
||||
MACOS_DIR="$APP_DIR/Contents/MacOS"
|
||||
RESOURCES_DIR="$APP_DIR/Contents/Resources"
|
||||
|
||||
# Create directory structure outside the source dir
|
||||
mkdir -p "$MACOS_DIR" "$RESOURCES_DIR"
|
||||
|
||||
# Move Info.plist and icon to specific locations
|
||||
mv "${{ matrix.app }}/Info.plist" "$APP_DIR/Contents/"
|
||||
mv "${{ matrix.app }}/DiscordChatExporter.icns" "$RESOURCES_DIR/"
|
||||
|
||||
# Move all remaining files to the MacOS directory
|
||||
find "${{ matrix.app }}" -maxdepth 1 -mindepth 1 -exec mv "{}" "$MACOS_DIR/" \;
|
||||
|
||||
# Move final .app bundle to the source directory so it can be zipped
|
||||
mv "$APP_DIR" "${{ matrix.app }}/$APP_NAME"
|
||||
|
||||
- name: Create package
|
||||
# Change into the artifacts directory to avoid including the directory itself in the zip archive
|
||||
working-directory: ${{ matrix.app }}/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue