-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (102 loc) · 3.95 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
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
120
121
122
123
124
125
126
127
128
129
130
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install FVM
run: choco install fvm
- name: Install Flutter SDK
run: fvm install
- name: Install dependencies
run: fvm flutter pub get
- name: Build for Windows
run: fvm flutter build windows
- name: Install yq
run: Invoke-WebRequest -URI "https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_windows_amd64.exe" -OutFile yq.exe
- name: Compress archive
id: compress
shell: pwsh
run: |
$VERSION=$(.\yq.exe -r ".version" pubspec.yaml | % { $_ -replace '\+.+', '' })
$FILENAME="dqm_installer_flt_${VERSION}_windows.zip"
echo "FILENAME=$FILENAME" >> "${env:GITHUB_OUTPUT}"
# Copy Visual C++ runtime libraries
Copy-Item .\windows\vcredist\* .\build\windows\x64\runner\Release\
cd build\windows\x64\runner
Move-Item -Path Release -Destination dqm_installer_flt
Compress-Archive -DestinationPath ..\..\..\..\$FILENAME -Path dqm_installer_flt
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: ${{ steps.compress.outputs.FILENAME }}
build_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install FVM
run: curl -fsSL https://fvm.app/install.sh | bash
- name: Install Flutter SDK
run: fvm install
- name: Import Apple provisioning profile
run: |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
echo -n "${{ secrets.PROVISIONING_PROFILE_BASE64 }}" | base64 -d > ~/Library/MobileDevice/Provisioning\ Profiles/DQM_Installer_FLT.provisionprofile
- name: Import code-signing certificate
uses: Apple-Actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERT_P12_BASE64 }}
p12-password: ${{ secrets.CERT_P12_PASS }}
- name: Import App Store Connect keychain
run: |
echo -n "${{ secrets.APP_STORE_CONNECT_KEY }}" > AuthKey_${{ secrets.APP_STORE_CONNECT_KEY_ID }}.p8
xcrun notarytool store-credentials "App Store Connect Profile" \
--key AuthKey_${{ secrets.APP_STORE_CONNECT_KEY_ID }}.p8 \
--key-id ${{ secrets.APP_STORE_CONNECT_KEY_ID }} \
--issuer ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER }}
- name: Install dependencies
run: fvm flutter pub get
- name: Build (Archive) for macOS
run: |
fvm flutter build macos --config-only
xcodebuild -workspace ./macos/Runner.xcworkspace -scheme Runner archive
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: build/macos/notarized/*.dmg
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install FVM
run: curl -fsSL https://fvm.app/install.sh | bash
- name: Install Flutter SDK
run: fvm install
- name: Install apt dependencies
run: |
sudo apt-get -y update
sudo apt-get install -y ninja-build libgtk-3-dev
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
chmod +x ./yq
- name: Install pub dependencies
run: fvm flutter pub get
- name: Build for Linux
run: fvm flutter build linux
- run: |
VERSION=$(./yq -r ".version" pubspec.yaml | sed -E 's/\+.*//')
cd build/linux/x64/release
mv bundle dqm_installer_flt
zip -r dqm_installer_flt_${VERSION}_linux.zip ./dqm_installer_flt
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: build/linux/x64/release/dqm_installer_flt_*.zip