-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.69 KB
/
build-and-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and Release
on:
push:
branches: ["main"]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build
run: |
xcodebuild clean archive \
-project MacMusicPlayer.xcodeproj \
-scheme MacMusicPlayer \
-archivePath $PWD/build/MacMusicPlayer.xcarchive \
-configuration Release
-destination 'generic/platform=macOS,name=Any Mac' \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
ONLY_ACTIVE_ARCH=NO \
ARCHS="arm64 x86_64"
- name: Create app
run: |
xcodebuild -exportArchive \
-archivePath $PWD/build/MacMusicPlayer.xcarchive \
-exportOptionsPlist exportOptions.plist \
-exportPath $PWD/build/export \
ONLY_ACTIVE_ARCH=NO \
ARCHS="arm64 x86_64"
- name: Prepare for DMG
run: |
mkdir -p dist
mv build/export/MacMusicPlayer.app dist/
ls -R dist
- name: Create DMG
run: |
hdiutil create -volname MacMusicPlayer \
-srcfolder dist \
-ov -format UDZO dist/MacMusicPlayer.dmg
- name: Create Release and Upload Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ github.run_number }} \
--title "Release ${{ github.run_number }}" \
--notes "Release ${{ github.run_number }}" \
./dist/MacMusicPlayer.dmg