-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 2.12 KB
/
build.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
62
63
64
65
66
67
68
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
name: Build
on: push
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Prepare Certificate
env:
CERTIFICATE: ${{ secrets.CERTIFICATE }}
CERTIFICATE_PWD: ${{ secrets.CERTIFICATE_PWD }}
KEYCHAIN_PWD: ${{ secrets.KEYCHAIN_PWD }}
run: |
echo $CERTIFICATE | base64 --decode > cert.p12
security create-keychain -p "$KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PWD" build.keychain
security import cert.p12 -k build.keychain -P "$CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PWD" build.keychain
- name: Build
run: |
fastlane build
- name: Create DMG
run: |
npm install --global create-dmg
create-dmg ./build/Monster.app ./build
mv ./build/Monster*.dmg ./build/Monster.dmg
- name: Notarization
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
TEAM_ID: ${{ secrets.TEAM_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
run: |
xcrun notarytool store-credentials "Notarization" --apple-id "$APPLE_ID" --team-id "$TEAM_ID" --password "$APPLE_PASSWORD"
xcrun notarytool submit ./build/Monster.dmg --keychain-profile "Notarization" --wait
xcrun stapler staple ./build/Monster.dmg
- name: Upload DMG
uses: actions/upload-artifact@v3
with:
name: Monster.dmg
path: ./build/Monster.dmg
- name: Upload dSYM
uses: actions/upload-artifact@v3
with:
name: Monster.app.dSYM.zip
path: ./build/Monster.app.dSYM.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./build/Monster.dmg
./build/Monster.app.dSYM.zip
draft: true
prerelease: true