-
Notifications
You must be signed in to change notification settings - Fork 23
151 lines (143 loc) · 4.78 KB
/
build-manual.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Manual build release
on:
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: Checkout awl code
uses: actions/checkout@v4
with:
fetch-depth: 0 # also fetch tags for 'git describe'
ref: ${{ github.event.inputs.awl_ref }}
path: 'awl'
- name: Checkout awl-flutter code
uses: actions/checkout@v4
with:
repository: 'anywherelan/awl-flutter'
ref: ${{ github.event.inputs.awl_flutter_ref }}
path: 'awl-flutter'
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x
cache: true
cache-dependency-path: |
awl/go.sum
awl/cmd/awl-tray/go.sum
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '12.x'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.x'
channel: 'stable'
- run: flutter --version
- name: Install ndk-bundle
run: |
echo "ls $ANDROID_HOME/"
ls -lah $ANDROID_HOME/ || true
echo "ls $ANDROID_HOME/tools/bin/"
ls -lah $ANDROID_HOME/tools/bin/ || true
echo "ls $ANDROID_HOME/cmdline-tools/latest/bin/"
ls -lah $ANDROID_HOME/cmdline-tools/latest/bin/ || true
echo "install ndk-bundle"
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk-bundle"
- 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_ROOT=$ANDROID_HOME/ndk-bundle
unset ANDROID_NDK_HOME
cd awl
go install golang.org/x/mobile/cmd/gomobile@latest
go get golang.org/x/mobile/cmd/gomobile
gomobile init
go mod tidy -compat=1.23
cd cmd/awl-tray && go mod tidy -compat=1.23 && cd ../..
echo "check go mod tidy and git dirty"
test -z "$(git status --porcelain)" || (git status; git diff && false)
echo "start building"
./build.sh release
echo "ls build"
ls -lah build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: awl-release-build
path: awl/build/*
if-no-files-found: error
- name: Upload flutter web artifacts
uses: actions/upload-artifact@v4
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@v4
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@v4
with:
name: awl-release-static
path: awl/static
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x
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@v4
with:
name: awl-release-build-macos
path: awl/build/*
if-no-files-found: error