-
Notifications
You must be signed in to change notification settings - Fork 22
122 lines (93 loc) · 3.3 KB
/
macos.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Macos Release
on:
workflow_dispatch:
jobs:
version:
runs-on: windows-latest
permissions:
contents: read
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/[email protected]
- name: Extract Version from pubspec.yaml
id: extract_version
run: |
$VERSION = Select-String -Path ".\pubspec.yaml" -Pattern "version: (\d+\.\d+\.\d+)" -CaseSensitive | ForEach-Object{ $_.Matches.Groups[1].Value }
echo version=$VERSION >> $env:GITHUB_OUTPUT
Build-macos:
runs-on: macos-latest
permissions:
contents: read
needs: version
steps:
- name: Checkout the code
uses: actions/[email protected]
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install npm dependencies
run: npm install -g appdmg
- name: Install flutter
uses: subosito/[email protected]
with:
flutter-version: "3.22.0"
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
- name: Enable linux-desktop for flutter
run: flutter config --enable-macos-desktop && export PATH="$PATH":"$HOME/.pub-cache/bin"
- name: Copy MacOS related files
run: |
cp macos/Runner/Release.entitlements .
cp -r macos/Runner/Assets.xcassets .
cp -r macos/packaging .
- name: Recreate MacOS directory
run: |
rm -rf macos
flutter create --platform macos .
- name: Replace MacOS files
run: |
mv packaging macos/
cp -f Release.entitlements macos/Runner/
cp -rf Assets.xcassets macos/Runner/
- name: Get dependencies
run: flutter pub get
- name: Install flutter_distributor
run: dart pub global activate flutter_distributor
- name: Start the build process
run: flutter_distributor package --platform macos --targets dmg
- name: Debug
run: ls dist/${{ needs.version.outputs.version }}
- name: Rename dmg File
run: mv dist/${{ needs.version.outputs.version }}/brisk-${{ needs.version.outputs.version }}+${{ needs.version.outputs.version }}-macos.dmg ./Brisk-${{ needs.version.outputs.version }}-macos-x64.dmg
- name: Upload artifact
uses: actions/[email protected]
with:
name: brisk-dmg
path: Brisk-${{ needs.version.outputs.version }}-macos-x64.dmg
retention-days: 1
Release:
runs-on: ubuntu-latest
needs: [Build-macos, version]
permissions:
contents: write
steps:
- name: Checkout the code
uses: actions/[email protected]
- name: Donwload artifact package
uses: actions/[email protected]
with:
name: brisk-dmg
- name: LS
run: ls .
- name: Release the changes
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.version.outputs.version }}
body_path: ./.github/release.md
files: ./Brisk-${{ needs.version.outputs.version }}-macos-x64.dmg