-
Notifications
You must be signed in to change notification settings - Fork 548
118 lines (97 loc) · 4.6 KB
/
build.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
name: Build Web
on:
push:
branches:
- master
#concurrency:
# group: ci-release-${{ github.ref }}-1
# cancel-in-progress: true
jobs:
build-main:
name: Build Web - MAIN
env:
commit_secret: ${{secrets.commit_secret}}
commit_email: ${{secrets.commit_email}}
commit_name: ${{secrets.commit_name}}
app_sentry: ${{secrets.app_sentry}}
api_secret: ${{secrets.api_secret}}
sentry_auth_token: ${{secrets.sentry_auth_token}}
sentry_org: ${{secrets.sentry_org}}
sentry_project: ${{secrets.sentry_project}}
sentry_url: ${{secrets.sentry_url}}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.6'
#channel: 'stable'
- name: Install Sentry
run: |
curl -sL https://sentry.io/get-cli/ | bash
- name: Check Flutter
run: |
flutter doctor -v
flutter pub get
flutter config --enable-web
- name: Prepare App
run: |
cp lib/.env.dart.example lib/.env.dart
sed -i 's/secret/${{secrets.api_secret}}/g' lib/.env.dart
echo "const FLUTTER_VERSION = const <String, String>" > lib/flutter_version.dart
flutter --version --machine >> lib/flutter_version.dart
echo ";" >> lib/flutter_version.dart
- name: Build Hosted App
run: |
#export SENTRY_RELEASE=$(sentry-cli releases propose-version)
#sentry-cli --auth-token ${{secrets.sentry_auth_token}} --url ${{secrets.sentry_url}} releases --org ${{secrets.sentry_org}} new $SENTRY_RELEASE --project ${{secrets.sentry_project}}
#sentry-cli --auth-token ${{secrets.sentry_auth_token}} --url ${{secrets.sentry_url}} releases --org ${{secrets.sentry_org}} set-commits --auto $SENTRY_RELEASE
flutter build web --dart-define=SENTRY_RELEASE=$SENTRY_RELEASE --source-maps
sed -i '/index.html/d' build/web/flutter_service_worker.js
git config --global user.email ${{secrets.commit_email}}
git config --global user.name ${{secrets.commit_name}}
git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/invoiceninja.git
cd invoiceninja
git checkout v5-develop
cp -r ../build/web/* ./public/
rm ./public/index.html
git add .
git commit -m 'Admin Portal - Hosted'
git push
cd ..
#sentry-cli --auth-token ${{secrets.sentry_auth_token}} --url ${{secrets.sentry_url}} releases --project ${{secrets.sentry_project}} --org ${{secrets.sentry_org}} files $SENTRY_RELEASE upload-sourcemaps . --ext dart --rewrite
cd ./build/web
#sentry-cli --auth-token ${{secrets.sentry_auth_token}} --url ${{secrets.sentry_url}} releases --project ${{secrets.sentry_project}} --org ${{secrets.sentry_org}} files $SENTRY_RELEASE upload-sourcemaps . --ext map --ext js --rewrite
cd ../..
#sentry-cli --auth-token ${{secrets.sentry_auth_token}} --url ${{secrets.sentry_url}} releases --org ${{secrets.sentry_org}} finalize $SENTRY_RELEASE
#sentry-cli --auth-token ${{secrets.sentry_auth_token}} --url ${{secrets.sentry_url}} releases --org ${{secrets.sentry_org}} deploys $SENTRY_RELEASE new -e production
- name: Build Profile App
run: |
flutter build web --profile
git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/invoiceninja.git invoiceninja_profile
cd invoiceninja_profile
git checkout v5-develop
cp ../build/web/main.dart.js ./public/main.profile.dart.js
git add .
git commit -m 'Admin Portal - Profile'
git push
cd ..
- name: Build Selfhosted App
run: |
cp lib/utils/oauth.dart.foss lib/utils/oauth.dart
cp lib/utils/app_review.dart.foss lib/utils/app_review.dart
cp lib/ui/app/upgrade_dialog.dart.foss lib/ui/app/upgrade_dialog.dart
cp lib/ui/app/pinput.dart.foss lib/ui/app/pinput.dart
cp pubspec.foss.yaml pubspec.yaml
flutter pub get
flutter build web
git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/invoiceninja.git invoiceninja_foss
cd invoiceninja_foss
git checkout v5-develop
cp ../build/web/main.dart.js ./public/main.foss.dart.js
cp ../build/web/main.dart.js.map ./public/main.foss.dart.js.map
git add .
git commit -m 'Admin Portal - Selfhosted'
git push