-
Notifications
You must be signed in to change notification settings - Fork 12
252 lines (227 loc) · 9.44 KB
/
release.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
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
name: Release
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
branches: [ main ]
jobs:
build_android:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
architecture: x64 # optional, x64 or arm64
- name: 🔐 Retrieve base64 keystore and decode it to a file
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > "${{ github.workspace }}/android-keystore.jks"
- name: 📝🔐 Create key.properties file
env:
KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/android/key.properties
run: |
echo 'storeFile=${{ github.workspace }}/android-keystore.jks' > $KEYSTORE_PROPERTIES_PATH
echo 'keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}' >> $KEYSTORE_PROPERTIES_PATH
echo 'storePassword=${{ secrets.KEYSTORE_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH
echo 'keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH
- name: pub get
run: flutter pub get
- name: build apk-split
run: flutter build apk --split-per-abi
- name: build apk
run: flutter build apk
# APK
- name: Upload APK to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-release.apk
asset_name: yana-${{ github.ref_name }}-android-universal.apk
asset_content_type: application/zip
- name: Upload APK to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
asset_name: yana-${{ github.ref_name }}-android-arm64-v8a.apk
asset_content_type: application/zip
- name: Upload APK to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
asset_name: yana-${{ github.ref_name }}-android-armeabi-v7a.apk
asset_content_type: application/zip
- name: Upload APK to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-x86_64-release.apk
asset_name: yana-${{ github.ref_name }}-android-x86_64.apk
asset_content_type: application/zip
# - name: flutter build appbundle
# run: flutter build appbundle
build_linux:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
architecture: x64 # optional, x64 or arm64
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libfuse2 libsecret-1-dev libjsoncpp-dev libsecret-1-0 libsecret-tools
- run: flutter config --enable-linux-desktop
- run: flutter pub get
- run: flutter build linux
- run: dart pub global activate flutter_distributor
- run: flutter_distributor package --platform linux --targets deb
- run: cp dist/*/*.deb yana-${{ github.ref_name }}-linux-x86_64.deb
#- run: flutter_distributor package --platform linux --targets appimage
- run: wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
- run: chmod +x appimagetool-x86_64.AppImage
- run: cp -r build/linux/x64/release/bundle/* Yana.AppDir/
- run: cp -r assets/imgs/logo/logo-new.png Yana.AppDir/logo.png
- run: ./appimagetool-x86_64.AppImage Yana.AppDir/
# LINUX APPIMAGE
- name: Upload appImage to release
id: upload-release-asset-appimage
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: Yana-x86_64.AppImage
asset_name: yana-${{ github.ref_name }}-linux-x86_64-.AppImage
asset_content_type: application/zip
# LINUX DEB
- name: Upload deb to release
id: upload-release-asset-deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: yana-${{ github.ref_name }}-linux-x86_64.deb
asset_name: yana-${{ github.ref_name }}-linux-x86_64.deb
asset_content_type: application/zip
# build_linux:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-java@v2
# with:
# distribution: 'zulu'
# java-version: '17'
# cache: 'gradle'
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: '3.13.0'
# channel: 'stable'
# cache: true
# cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
# cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
# architecture: x64 # optional, x64 or arm64
# - run: |
# sudo apt-get update -y
# sudo apt-get install -y ninja-build libgtk-3-dev libfuse2 libsecret-1-dev libjsoncpp-dev libsecret-1-0 libsecret-tools
# - run: flutter config --enable-linux-desktop
# - run: flutter pub get
# # - run: flutter test
# - run: flutter build linux
# - run: wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
# - run: chmod +x appimagetool-x86_64.AppImage
# - run: cp -r build/linux/x64/release/bundle/* Yana.AppDir/
# - run: cp -r assets/imgs/logo/logo.png Yana.AppDir/
# - run: ./appimagetool-x86_64.AppImage Yana.AppDir/
# - name: 'Artifact'
# uses: actions/upload-artifact@v2
# with:
# name: Yana-x86_64.AppImage
# path: Yana-x86_64.AppImage
#
release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
id: ${{ steps.create_release.outputs.id }}
steps:
# Create Release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
body: |
------
Verify the signature of the .apk file:
`keytool -printcert -jarfile <.apk-file> |grep SHA256`
Compare this with the SHA256 found on nostr profile for [Yana](https://njump.me/npub1gp4xzpmluelsakjtayc4wtzj97fhj5kakqjvsannu00xkdlf4x8s0xdqyq)
release_name: Release ${{ github.ref }}
draft: true
# prerelease: true
publish-release:
needs: [release,build_android,build_linux]
runs-on: ubuntu-latest
steps:
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.release.outputs.id }}
dockerimage:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: fmar/yana
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
#LINUX -> flutter_distributor package --platform linux --targets appimage