-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path.gitlab-ci.yml
129 lines (118 loc) · 3.85 KB
/
.gitlab-ci.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
image: cirrusci/flutter:dev
before_script:
- echo "$keybase64" > ./keybase64
- mkdir -p /builds/testapp-system/testapp-flutter/android/app/android/app/
- base64 -d ./keybase64 > /builds/testapp-system/testapp-flutter/android/app/android/app/key.jks
- echo "$KEYPROPERTIES" > ./android/key.properties
- export VERSION=$(cat pubspec.yaml | grep version | awk '{ print $2 }' | cut -f1 -d "+")
stages:
- build
- deploy
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- xournalpp-web-*
build:apk:
stage: build
script:
- set +o pipefail
- flutter build apk
- set -o pipefail
- mv build/app/outputs/apk/release/app-release.apk xournalpp-mobile-$VERSION.apk
artifacts:
paths:
- xournalpp-mobile-*.apk
build:bundle:
stage: build
script:
- flutter build appbundle
- mv build/app/outputs/bundle/release/app-release.aab xournalpp-mobile-$VERSION.aab
artifacts:
paths:
- xournalpp-mobile-*.aab
build:web:
stage: build
script:
- flutter config --enable-web
- flutter pub get
- set +o pipefail
- flutter build web #--dart-define=FLUTTER_WEB_USE_SKIA=true
- cp -r build/web xournalpp-web-$VERSION
artifacts:
paths:
- xournalpp-web-*
build:debian:
stage: build
image: ubuntu
script: |
export DEBIAN_FRONTEND=noninteractive
# required to upgrade ubuntu base due to incompatible libraries
apt update -qq
apt install -y -qq wget tar unzip zip lib32stdc++6 lib32z1 git clang cmake ninja-build pkg-config libgtk-3-dev curl dh-make meson
# flutter sdk setup
git clone -b master https://github.com/flutter/flutter.git /flutter
export PATH=$PATH:/flutter/bin
flutter config --enable-linux-desktop
sed -i "s/DATE/$(date -R)/g" debian/changelog
sed -i "s/VERSION/$VERSION/g" debian/changelog
dpkg-buildpackage
mv ../xournalpp-mobile_*.deb xournalpp-mobile-$VERSION.deb
artifacts:
paths:
- xournalpp-mobile-*.deb
build:linux:
stage: build
image: snapcore/snapcraft:edge
script: |
# required to upgrade ubuntu base due to incompatible libraries
sed -i "s/xenial/focal/g" /etc/apt/sources.list
apt update -qq
apt install -y -qq wget tar unzip zip lib32stdc++6 lib32z1 git clang cmake ninja-build pkg-config libgtk-3-dev curl
# flutter sdk setup
git clone -b master https://github.com/flutter/flutter.git /flutter
export PATH=$PATH:/flutter/bin
flutter config --enable-linux-desktop
flutter build linux
mv build/linux/x64/release/bundle xournalpp-mobile-$VERSION
artifacts:
paths:
- xournalpp-mobile-*
build:snap:
stage: build
image: snapcore/snapcraft:edge
script: |
# required to upgrade ubuntu base due to incompatible libraries
sed -i "s/xenial/focal/g" /etc/apt/sources.list
apt update -qq
apt install -y -qq wget tar unzip zip lib32stdc++6 lib32z1 git clang cmake ninja-build pkg-config libgtk-3-dev curl
# flutter sdk setup
git clone -b master https://github.com/flutter/flutter.git /flutter
export PATH=$PATH:/flutter/bin
flutter config --enable-linux-desktop
# ignore current snap version and set to pubspec version
# "s/version\:\W\+[0-9]\+\.[0-9]\+\.[0-9]\+/version: $VERSION/g" or "s/[0-9]\+\.[0-9]\+\.[0-9]\+/$VERSION/g"
sed -i "s/version\:\W\+[0-9]\+\.[0-9]\+\.[0-9]\+/version: $VERSION/g" snap/snapcraft.yaml
echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > snapcraft.login
snapcraft login --with snapcraft.login
set +o pipefail
snapcraft
mv *.snap xournalpp-mobile-$VERSION.snap
snapcraft upload xournalpp-mobile-$VERSION.snap --release=stable
artifacts:
paths:
- xournalpp-mobile-*.snap
only:
- tags
except:
- branches
pages:
stage: deploy
image: alpine:latest
script:
- mkdir public
- cp -r xournalpp-web-$VERSION/* public/
artifacts:
paths:
- public
only:
- master