-
Notifications
You must be signed in to change notification settings - Fork 37
212 lines (200 loc) · 6.72 KB
/
Copy pathbuild-manual.yml
File metadata and controls
212 lines (200 loc) · 6.72 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Manual build release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
awl_ref:
description: 'The branch, tag or SHA of awl repository'
required: true
default: 'master'
awl_flutter_ref:
description: 'The branch, tag or SHA of awl-flutter repository'
required: true
default: 'master'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: false
swap-storage: false
docker-images: true
dotnet: true
haskell: true
large-packages: true
- name: Checkout awl code
uses: actions/checkout@v6
with:
fetch-depth: 0 # also fetch tags for 'git describe'
ref: ${{ github.event.inputs.awl_ref || github.ref }}
path: 'awl'
- name: Checkout awl-flutter code
uses: actions/checkout@v6
with:
repository: 'anywherelan/awl-flutter'
ref: ${{ github.event.inputs.awl_flutter_ref || github.ref }}
path: 'awl-flutter'
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: 1.26.2
cache: true
cache-dependency-path: |
awl/go.sum
awl/cmd/awl-tray/go.sum
- uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17.x'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.10'
channel: 'stable'
- run: flutter --version
- name: Install ndk
run: |
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.3.13750724"
- name: List available space
run: |
df -h
- name: Configure Keystore for Android
run: |
echo "$KEYSTORE_UPLOAD_JKS" | base64 --decode > app/upload-keystore.jks
echo "storeFile=upload-keystore.jks" >> key.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties
env:
KEYSTORE_UPLOAD_JKS: ${{ secrets.KEYSTORE_UPLOAD_JKS }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
working-directory: awl-flutter/android
- name: Build
run: |
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.3.13750724
unset ANDROID_NDK_ROOT
export SOURCE_DATE_EPOCH=$(git -C awl-flutter log -1 --format=%ct)
cd awl
GOMOBILE_VERSION=$(go list -m -f '{{.Version}}' golang.org/x/mobile)
go install golang.org/x/mobile/cmd/gomobile@$GOMOBILE_VERSION
gomobile init
go mod tidy -compat=1.26
cd cmd/awl-tray && go mod tidy -compat=1.26 && cd ../..
echo "check go mod tidy and git dirty"
test -z "$(git status --porcelain)" || (git status; git diff && false)
cd ../awl-flutter && flutter pub get && cd ../awl
echo "=== Patching flutter_zxing for reproducible builds ==="
sed -i '1a add_link_options("LINKER:--build-id=none")' $HOME/.pub-cache/hosted/pub.dev/flutter_zxing-*/src/CMakeLists.txt
echo "start building"
./build.sh release
echo "ls build"
ls -lah build
- name: List available space
run: |
df -h
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: awl-release-build
path: awl/build/*
if-no-files-found: error
- name: Upload flutter web artifacts
uses: actions/upload-artifact@v7
with:
name: awl-release-static
path: awl/static/
if-no-files-found: error
- name: Assert number of built files
run: |
files_count="$(ls -1q awl/build/ | wc -l)"
echo "built $files_count files"
if [ "$files_count" != "17" ]; then
echo "::error::Files count mismatch"
exit 1
fi
build-macos:
runs-on: macos-latest
needs: [ build ]
defaults:
run:
shell: bash
steps:
- name: Checkout awl code
uses: actions/checkout@v6
with:
fetch-depth: 0 # also fetch tags for 'git describe'
ref: ${{ github.event.inputs.awl_ref }}
path: 'awl'
- name: Retrieve saved static/ build
uses: actions/download-artifact@v8
with:
name: awl-release-static
path: awl/static
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: 1.26.2
cache: true
cache-dependency-path: |
awl/go.sum
awl/cmd/awl-tray/go.sum
- name: Build
run: |
cd awl
mkdir build
./build.sh release-macos
echo "ls build"
ls -lah build
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: awl-release-build-macos
path: awl/build/*
if-no-files-found: error
build-windows7:
runs-on: ubuntu-latest
needs: [ build ]
defaults:
run:
shell: bash
steps:
- name: Checkout awl code
uses: actions/checkout@v6
with:
fetch-depth: 0 # also fetch tags for 'git describe'
ref: ${{ github.event.inputs.awl_ref }}
path: 'awl'
- name: Retrieve saved static/ build
uses: actions/download-artifact@v8
with:
name: awl-release-static
path: awl/static
- name: Download and setup go-legacy-win7
run: |
mkdir -p /tmp/go-legacy-setup
wget -P /tmp/go-legacy-setup https://github.com/thongtech/go-legacy-win7/releases/download/v1.26.1-1/go-legacy-win7-1.26.1-1.linux_amd64.tar.gz
tar -xzf /tmp/go-legacy-setup/go-legacy-win7-1.26.1-1.linux_amd64.tar.gz -C /tmp/go-legacy-setup
export GOROOT=/tmp/go-legacy-setup/go-legacy-win7
export PATH=$GOROOT/bin:$PATH
go version
- name: Build
run: |
cd awl
mkdir build
export GOROOT=/tmp/go-legacy-setup/go-legacy-win7
export PATH=$GOROOT/bin:$PATH
./build.sh release-windows7
echo "ls build"
ls -lah build
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: awl-release-build-windows7
path: awl/build/*
if-no-files-found: error