-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (89 loc) · 3.37 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
name: Release
on:
release:
jobs:
apk:
name: Release APK
runs-on: 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'
flutter-version: '2.10.2'
- name: Make Key.properties and JKS File
run: |
echo keyPassword=\${{ secrets.KEY_PASSWORD }} > $GITHUB_WORKSPACE/android/key.properties
echo storePassword=\${{ secrets.KEYSTORE_PASSWORD }} >> $GITHUB_WORKSPACE/android/key.properties
echo keyAlias=\${{ secrets.KEY_ALIAS }} >> $GITHUB_WORKSPACE/android/key.properties
echo "${{ secrets.KEYSTORE }}" | base64 -d > $GITHUB_WORKSPACE/android/treehouses-remote.jks
- name: Build Signed APK
run: |
flutter clean
flutter pub get
flutter pub upgrade
flutter build apk --release
- run: cd build/app/outputs && tree
- run: |
cd build/app/outputs/flutter-apk/
mv app.apk blueshot.apk || true
mv app.apk.sha1 hashblue.apk.sha1 || true
mv app-release.apk blue-release.apk || true
mv app-debug.apk blue-bug.apk || true
ls -al
- name: Mobile Security Framework
run: |
docker pull opensecurity/mobile-security-framework-mobsf
docker run -itd -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest
cd build/app/outputs/flutter-apk/
ls -al
wget http://localhost:8000/api_docs
MOBSF_API_KEY=$(grep 'REST API Key' api_docs)
MOBSF_API_KEY=${MOBSF_API_KEY:42:64}
rm api_docs
HASH=$(md5sum blueshot.apk)
HASH=${HASH:0:32}
curl -F "[email protected]" http://localhost:8000/api/v1/upload -H "Authorization:$MOBSF_API_KEY"
curl -X POST --url http://localhost:8000/api/v1/scan --data "scan_type=apk&file_name=remote.apk&hash=$HASH" -H "Authorization:$MOBSF_API_KEY"
curl -X POST --url http://localhost:8000/api/v1/download_pdf --data "hash=$HASH" -H "Authorization:$MOBSF_API_KEY" --output ${{ steps.build_id.outputs.id }}-security-scan.pdf
ls -al
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/app/outputs/flutter-apk/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
iOS:
name: Release iOS
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
- run: flutter pub get
- run: flutter build ios --release --no-codesign
- run: brew install tree
- run: |
cd /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/build/ios/iphoneos
mkdir Payload
cp -R Runner.app Payload
/usr/bin/zip -r Payload.ipa Payload iTunesArtwork #no iTunes
tree
ls -al
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUBTOKEN }}
file: /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/build/ios/iphoneos/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true