-
Notifications
You must be signed in to change notification settings - Fork 31
174 lines (158 loc) · 6.67 KB
/
publish.yaml
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
name: Publish
on:
push:
branches:
- main
concurrency:
group: publish
cancel-in-progress: true
env:
PUB_CACHE: ~/.pub-cache
jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
flutter_version: ${{ steps.flutter_version.outputs.FLUTTER_VERSION }}
build_number: ${{ steps.build_number.outputs.BUILD_NUMBER }}
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Set flutter version
id: flutter_version
run: echo "FLUTTER_VERSION=$(jq ".flutterSdkVersion" -r < .fvm/fvm_config.json | cut -d "@" -f 1)" >> $GITHUB_OUTPUT
- name: Set build number
id: build_number
run: echo "BUILD_NUMBER=$(date +"%s")" >> $GITHUB_OUTPUT
android:
name: Android
runs-on: ubuntu-22.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2
with:
flutter-version: ${{ needs.setup.outputs.flutter_version }}
channel: 'stable'
cache: true
- name: Pub dependency cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: ${{ env.PUB_CACHE }}
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Gradle dependency cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 11
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
with:
distribution: 'adopt'
java-version: 11
- name: Build
run: cd packages/app && flutter build apk --split-per-abi --build-number="${{ needs.setup.outputs.build_number }}"
- uses: ilharp/sign-android-release@2034987c31e3959f7c97e88d5e656e52e6e88bd8 # v1
name: Sign
with:
releaseDir: packages/app/build/app/outputs/flutter-apk
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
with:
name: Android arm64-v8a
path: packages/app/build/app/outputs/flutter-apk/app-arm64-v8a-release-signed.apk
if-no-files-found: error
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
with:
name: Android armeabi-v7a
path: packages/app/build/app/outputs/flutter-apk/app-armeabi-v7a-release-signed.apk
if-no-files-found: error
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
with:
name: Android x86_64
path: packages/app/build/app/outputs/flutter-apk/app-x86_64-release-signed.apk
if-no-files-found: error
- name: F-Droid nightly
run: |
cp packages/app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk app-arm64-v8a-debug.apk
cp packages/app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk app-armeabi-v7a-debug.apk
cp packages/app/build/app/outputs/flutter-apk/app-x86_64-release.apk app-x86_64-debug.apk
sudo add-apt-repository ppa:fdroid/fdroidserver
sudo apt-get update
sudo apt-get install apksigner fdroidserver python3-pip --no-install-recommends
sudo apt-get purge fdroidserver
pip3 install https://gitlab.com/fdroid/fdroidserver/-/archive/master/fdroidserver.tar.gz
export DEBUG_KEYSTORE=${{ secrets.DEBUG_KEYSTORE }}
GITHUB_REPOSITORY=provokateurin/nextcloud-neon fdroid nightly -v --archive-older 10
linux_x86_64:
name: Linux x86_64
runs-on: ubuntu-22.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2
with:
flutter-version: ${{ needs.setup.outputs.flutter_version }}
channel: 'stable'
cache: true
- name: Pub dependency cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: ${{ env.PUB_CACHE }}
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install dependencies
run: |
sudo apt-get install \
-y --no-install-recommends \
clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev \
libappindicator3-dev
- name: Build
run: cd packages/app && flutter build linux --build-number="${{ needs.setup.outputs.build_number }}"
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
with:
name: Linux x86_64
path: packages/app/build/linux/x64/release/bundle/*
if-no-files-found: error
linux_arm64:
name: Linux arm64
runs-on: ubuntu-22.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Set docker image
id: docker_image
run: |
echo "local=nextcloud-neon-build-linux-arm64:${{ needs.setup.outputs.flutter_version }}" >> $GITHUB_OUTPUT
echo "remote=ghcr.io/$GITHUB_REPOSITORY/build-linux-arm64:${{ needs.setup.outputs.flutter_version }}" >> $GITHUB_OUTPUT
- run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2
with:
platforms: linux/arm64
- name: Build
env:
FLUTTER_VERSION: ${{ needs.setup.outputs.flutter_version }}
run: ./tool/build-app.sh linux/arm64 --build-number="${{ needs.setup.outputs.build_number }}"
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
with:
name: Linux arm64
path: packages/app/build/linux/arm64/release/bundle/*
if-no-files-found: error