Skip to content

Commit 54c61dd

Browse files
committed
setup: release workflow
1 parent b425b8e commit 54c61dd

File tree

4 files changed

+105
-2
lines changed

4 files changed

+105
-2
lines changed

.github/exportOptions.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>destination</key>
6+
<string>export</string>
7+
<key>method</key>
8+
<string>development</string>
9+
<key>signingStyle</key>
10+
<string>automatic</string>
11+
<key>stripSwiftSymbols</key>
12+
<true/>
13+
<key>teamID</key>
14+
<string>6GLWGGY9D7</string>
15+
<key>thinning</key>
16+
<string>&lt;none&gt;</string>
17+
</dict>
18+
</plist>
400 KB
Loading

.github/workflows/release.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build and Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
name: Build and sign app
10+
permissions:
11+
contents: write
12+
runs-on: macos-26
13+
environment: main
14+
env:
15+
projname: "MewNotch"
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install create-dmg
21+
run: brew install create-dmg
22+
23+
- name: Resolve Swift packages
24+
run: xcodebuild -resolvePackageDependencies -project ${{ env.projname }}.xcodeproj
25+
26+
- name: Install Apple certificate
27+
env:
28+
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
29+
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
30+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
31+
run: |
32+
CERT_PATH=$RUNNER_TEMP/build_certificate.p12
33+
KC=$RUNNER_TEMP/app-signing.keychain-db
34+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode > "$CERT_PATH"
35+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KC"
36+
security set-keychain-settings -lut 21600 "$KC"
37+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KC"
38+
security import "$CERT_PATH" -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k "$KC"
39+
security list-keychain -d user -s "$KC"
40+
security find-identity -v -p codesigning
41+
42+
- name: Build with Xcode 26
43+
run: xcodebuild -version
44+
45+
- name: Build and archive
46+
run: |
47+
xcodebuild clean archive \
48+
-project ${{ env.projname }}.xcodeproj \
49+
-scheme ${{ env.projname }} \
50+
-archivePath ${{ env.projname }} \
51+
-destination "generic/platform=macOS" \
52+
ONLY_ACTIVE_ARCH=NO \
53+
-allowProvisioningUpdates
54+
55+
- name: Export app
56+
run: |
57+
xcodebuild -exportArchive -archivePath "${{ env.projname }}.xcarchive" -exportPath Release -exportOptionsPlist ".github/exportOptions.plist"
58+
59+
# Rename exported app to "Mew Notch.app" for DMG
60+
mv "Release/MewNotch.app" "Release/Mew Notch.app"
61+
62+
- name: Create DMG
63+
run: |
64+
create-dmg \
65+
--volname "MewNotch Installer" \
66+
--volicon "MewNotch/Resources/Assets/MewAssets.xcassets/AppIcon.appiconset/MewNotch-1024.png" \
67+
--window-pos 200 120 \
68+
--window-size 800 400 \
69+
--background ".github/res/Installer-Background.png" \
70+
--icon-size 128 \
71+
--icon "Mew Notch.app" 200 185 \
72+
--hide-extension "Mew Notch.app" \
73+
--app-drop-link 600 185 \
74+
"MewNotch-${{ github.ref_name }}.dmg" \
75+
"Release/Mew Notch.app"
76+
77+
- name: Upload Release Asset
78+
uses: actions/upload-release-asset@v1
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
with:
82+
upload_url: ${{ github.event.release.upload_url }}
83+
asset_path: ./MewNotch-${{ github.ref_name }}.dmg
84+
asset_name: MewNotch-${{ github.ref_name }}.dmg
85+
asset_content_type: application/x-apple-diskimage

MewNotch.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
"@executable_path/../Frameworks",
355355
);
356356
MACOSX_DEPLOYMENT_TARGET = 14.0;
357-
MARKETING_VERSION = 1.2.1;
357+
MARKETING_VERSION = 1.2.2;
358358
PRODUCT_BUNDLE_IDENTIFIER = com.monuk7735.mew.notch;
359359
PRODUCT_NAME = "$(TARGET_NAME)";
360360
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -397,7 +397,7 @@
397397
"@executable_path/../Frameworks",
398398
);
399399
MACOSX_DEPLOYMENT_TARGET = 14.0;
400-
MARKETING_VERSION = 1.2.1;
400+
MARKETING_VERSION = 1.2.2;
401401
PRODUCT_BUNDLE_IDENTIFIER = com.monuk7735.mew.notch;
402402
PRODUCT_NAME = "$(TARGET_NAME)";
403403
SWIFT_EMIT_LOC_STRINGS = YES;

0 commit comments

Comments
 (0)