forked from mozilla/notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
113 lines (93 loc) · 3.34 KB
/
circle.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
version: 2
jobs:
webextension:
working_directory: ~/notes
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
key: node-v1-{{ checksum "package.json" }}-{{ arch }}
- run: npm install
- save_cache:
key: node-v1-{{ checksum "package.json" }}-{{ arch }}
paths:
- node_modules
- run: npm run build
- run: npm run lint
- persist_to_workspace:
root: ~/notes
paths:
- node_modules
- run: mkdir -p /tmp/artifacts;
- run: cp web-ext-artifacts/*.zip /tmp/artifacts
- store_artifacts:
path: /tmp/artifacts
android:
working_directory: ~/notes/native
docker:
- image: circleci/android:api-25-node8-alpha
steps:
- checkout
- restore_cache:
key: node-native-v1-{{ checksum "native/package.json" }}-{{ arch }}
- run: cd native && npm install
- save_cache:
key: node-native-v1-{{ checksum "native/package.json" }}-{{ arch }}
paths:
- native/node_modules
- persist_to_workspace:
root: ~/notes/native
paths:
- native/node_modules
- run: cd native && ./misc/download_keystore.sh
- run: cd native && node ./misc/config-generator.js
- run: cd native && perl -pi -w -e "s/1.0android/1.0android-c$CIRCLE_BUILD_NUM/g;" android/app/build.gradle
- run: cd native/android && ./gradlew assembleRelease -PMYAPP_RELEASE_STORE_FILE=$MYAPP_RELEASE_STORE_FILE -PMYAPP_RELEASE_KEY_ALIAS=$MYAPP_RELEASE_KEY_ALIAS -PMYAPP_RELEASE_STORE_PASSWORD=$MYAPP_RELEASE_STORE_PASSWORD -PMYAPP_RELEASE_KEY_PASSWORD=$MYAPP_RELEASE_KEY_PASSWORD
- run: mkdir -p /tmp/artifacts-android;
- run: cp native/android/app/build/outputs/apk/release/app-release.apk /tmp/artifacts-android
- run: cp /tmp/artifacts-android/app-release.apk /tmp/artifacts-android/notes-1_0-qa-v$CIRCLE_BUILD_NUM.apk
- store_artifacts:
path: /tmp/artifacts-android
- save_cache:
key: apk-v1-{{ .Branch }}-{{epoch}}
paths:
- /tmp/artifacts-android/app-release.apk
signapk:
working_directory: ~/notes/native
docker:
- image: circleci/android:api-25-node8-alpha
steps:
- restore_cache:
key: apk-v1-{{ .Branch }}
- run:
name: Sign APK
command: |
curl -F "input=@/tmp/artifacts-android/app-release.apk" \
-o /tmp/artifacts-android/app-release-signed.apk \
-H "Authorization: $AUTOGRAPH_EDGE_TOKEN" \
https://autograph-edge.prod.mozaws.net/sign
- run:
name: Verify APK
command: |
sudo apt update
sudo apt install -y android-sdk-build-tools
/opt/android/sdk/build-tools/27.0.3/apksigner verify --verbose /tmp/artifacts-android/app-release-signed.apk
- store_artifacts:
path: /tmp/artifacts-android
workflows:
version: 2
node-android-signapk:
jobs:
- webextension
- android
- signapk:
requires:
- android
filters:
tags:
only: /android-[0-9]\.[0-9]\.[0-9]/
branches:
only:
- master
- /prepare-.*/ # or regexes