This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
109 lines (104 loc) · 3.5 KB
/
main.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
name: CI
on:
push:
tags: ['v*']
branches: [master]
jobs:
build-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- run: sudo apt install -y libsqlite3-dev libjsoncpp-dev libsecret-1-dev libgtk-3-dev pkg-config clang ninja-build cmake
- uses: subosito/flutter-action@v1
with:
flutter-version: "3.7.x"
channel: "stable"
- run: flutter pub get
- run: flutter packages pub run build_runner build
- run: wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
- run: chmod +x appimage-builder-x86_64.AppImage
- run: ./appimage-builder-x86_64.AppImage --skip-tests
- uses: actions/upload-artifact@v1
with:
name: photoprism-appimage
path: PhotoPrism-latest-x86_64.AppImage
build:
services:
photoprism:
image: thielepaul/photoprism:db-api-demo
ports:
- 2342:2342
runs-on: ubuntu-latest
steps:
- run: sudo apt install libsqlite3-dev
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: "11"
- uses: subosito/flutter-action@v1
with:
flutter-version: "3.7.x"
channel: "stable"
- run: flutter pub get
- run: flutter format --dry-run --set-exit-if-changed lib
- run: flutter packages pub run build_runner build
- run: flutter analyze --pub
- run: flutter test --coverage
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
- env:
KEY_JKS: ${{ secrets.KEY_JKS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: echo "$KEY_JKS" | base64 -d > key.jks && flutter build apk --pub --flavor prod --no-shrink
- uses: actions/upload-artifact@v1
with:
name: photoprism-apk
path: build/app/outputs/apk/prod/release/
release-master:
needs:
- build
- build-linux
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/download-artifact@v1
with:
name: photoprism-apk
- run: mv photoprism-apk/app-prod-release.apk photoprism.apk
- uses: actions/download-artifact@v1
with:
name: photoprism-appimage
- run: mv photoprism-appimage/PhotoPrism-latest-x86_64.AppImage photoprism.AppImage
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-db-api"
prerelease: true
title: "Development CI Build (DB API)"
files: |
photoprism.apk
photoprism.AppImage
release-tag:
needs:
- build
- build-linux
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
steps:
- uses: actions/download-artifact@v1
with:
name: photoprism-apk
- run: mv photoprism-apk/app-prod-release.apk photoprism.apk
- uses: actions/download-artifact@v1
with:
name: photoprism-appimage
- run: mv photoprism-appimage/PhotoPrism-latest-x86_64.AppImage photoprism.AppImage
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
photoprism.apk
photoprism.AppImage