-
Notifications
You must be signed in to change notification settings - Fork 54
95 lines (91 loc) · 3.33 KB
/
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Release
on:
push:
branches:
- main
workflow_dispatch:
env:
FLUTTER_VERSION: '3.24.3'
jobs:
release_with_macos_dmg:
permissions:
contents: write
pull-requests: write
runs-on: macos-latest
env:
MACOS_APP_RELEASE_PATH: build/macos/Build/Products/Release
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: dart
- uses: actions/checkout@v4
with:
fetch-depth: 5
- uses: subosito/flutter-action@v2
if: ${{ steps.release.outputs.release_created }}
with:
channel: 'stable'
flutter-version: ${{env.FLUTTER_VERSION}}
- name: Build macOS app
id: buildmacos
if: ${{ steps.release.outputs.release_created }}
run: flutter build macos --release
- name: Codesign executable
id: codesignmacos
if: steps.buildmacos.outcome == 'success'
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
MACOS_IDENTITY: ${{ secrets.MACOS_IDENTITY }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
echo "Create Keychain"
security create-keychain -p $MACOS_CERTIFICATE_PWD build.keychain
echo "Assign to Login Keychain"
security default-keychain -s build.keychain
echo "Unlock the Login Keychain"
security unlock-keychain -p $MACOS_CERTIFICATE_PWD build.keychain
echo "Import certificate"
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
echo "Set Key Partition"
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CERTIFICATE_PWD build.keychain
echo "Find Identity"
security find-identity
echo "Sign the app"
/usr/bin/codesign --force --deep -s $MACOS_IDENTITY ./$MACOS_APP_RELEASE_PATH/musicpod.app
- name: Create a dmg
id: createdmg
if: steps.codesignmacos.outcome == 'success'
run: |
echo "Install create-dmg"
brew install create-dmg
cd $MACOS_APP_RELEASE_PATH
create-dmg \
--volname "musicpod" \
--window-pos 200 120 \
--window-size 950 820 \
--icon-size 130 \
--text-size 14 \
--icon "musicpod.app" 260 250 \
--hide-extension "musicpod.app" \
--app-drop-link 540 250 \
--hdiutil-quiet \
"musicpod.dmg" \
"musicpod.app"
pwd
ls -l
- name: Upload Release Artifact
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.release.outputs.tag_name }} /Users/runner/work/musicpod/musicpod/build/macos/Build/Products/Release/musicpod.dmg
# Disabled because it does not work
# AppImage
# - run: flutter clean
# - run: flutter build linux --release -v
# - uses: AppImageCrafters/build-appimage@master
# with:
# recipe: "./appimage/AppImageBuilder.yml"
# env:
# UPDATE_INFO: gh-releases-zsync|ubuntu-flutter-community|musicpod|latest|*x86_64.AppImage.zsync