forked from icemanbsi/searchable_dropdown
-
-
Notifications
You must be signed in to change notification settings - Fork 44
126 lines (114 loc) · 4.83 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: CI-CD
on:
push:
paths:
- 'pubspec.yaml'
- '.github/workflows/main.yaml'
jobs:
test:
name: CI-CD from ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# publishing to pub.dev is only possible from Linux apparently
# os: [macos-latest]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get
- run: dart format .
- run: flutter analyze
- run: flutter config --enable-web
- run: flutter config --enable-linux-desktop
- run: flutter test
- run: pushd example&&flutter build web
- run: sed -i 's/<base href="\/">/<base href="\/search_choices\/demo\/">/g' example/build/web/index.html
- run: mkdir -p emptyRoot
- run: mv example/build/web/ emptyRoot/demo
-
name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: master
build_dir: emptyRoot
jekyll: false
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
integration_test:
name: CI-CD integration test
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
- run: scrcpy --record-format=mkv -r example/integration_test.mkv &
- run: cd example &&flutter test integration_test/example_test.dart --dart-define="flutsterKey=${{ secrets.FLUTSTERAPIKEY }}" --dart-define="flutsterUser=${{ secrets.FLUTSTERAPIUSER }}" --dart-define="flutsterUrl=${{ secrets.FLUTSTERAPIURL }}";killall scrcpy
- run: ~/knock.sh ${{ secrets.jodhost }};scp example/integration_test.mkv ${{ secrets.jodsshuser }}@${{ secrets.jodhost }}:~/fromgithub/
# - name: Publish
# uses: sakebook/[email protected]
# with:
# credential: ${{ secrets.CREDENTIAL_JSON }}
# flutter_package: false
# skip_test: true
# - run: pushd example&&flutter build web
# - run: sudo apt-get install -y knockd
# - run: knock ${{ secrets.knockparameters }}
# - name: Deploy web
# uses: garygrossgarten/github-action-scp@release
# with:
# local: example/build/web
# remote: fromgithub/
# host: ${{ secrets.jodhost }}
# username: ${{ secrets.jodsshuser }}
# password: ${{ secrets.jodsshpassword }}
# recursive: true
# - run: pushd example&&flutter build apk --release
# - run: knock ${{ secrets.knockparameters }}
# - name: Deploy apk
# uses: garygrossgarten/github-action-scp@release
# with:
# local: example/build/app/outputs/apk/release
# remote: fromgithub/
# host: ${{ secrets.jodhost }}
# username: ${{ secrets.jodsshuser }}
# password: ${{ secrets.jodsshpassword }}
# recursive: true
# cannot build linux bundle on github because not allowed to run apt-get install
# - run: apt-get install cmake gcc g++ ninja&&export ENABLE_FLUTTER_DESKTOP=true&&pushd example&&flutter config --enable-linux-desktop&&flutter create .&&flutter build linux --release&&tar -cvjf search_choices_example_linux_bundle_x64.tar.bz2 build/linux/x64/release/bundle/
# - run: knock ${{ secrets.knockparameters }}
# - name: Deploy Linux bundle
# uses: garygrossgarten/github-action-scp@release
# with:
# local: example/search_choices_example_linux_bundle_x64.tar.bz2
# remote: fromgithub/
# host: ${{ secrets.jodhost }}
# username: ${{ secrets.jodsshuser }}
# password: ${{ secrets.jodsshpassword }}
# recursive: true
# ios build fails apparently because of missing signature despite the --no-codesign parameter
# - run: pushd example&&flutter build ios --release --no-codesign
# - name: Deploy ios
# - run: knock ${{ secrets.knockparameters }}
# uses: garygrossgarten/github-action-scp@release
# with:
# local: example/build/ios/iphoneos/Runner.app
# remote: fromgithub/
# host: ${{ secrets.jodhost }}
# username: ${{ secrets.jodsshuser }}
# password: ${{ secrets.jodsshpassword }}
# recursive: true
#unclear why this publication fails from CD but it's ok from manual command: flutter pub publish
# # this publication method first checks whether the versions are different
# - name: Publish to pub.dev if newer version number
# uses: k-paxian/dart-package-publisher@master
# with:
## accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
## refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}
# credentialJson: ${{ secrets.CREDENTIAL_JSON }}
# skipTests: true