-
-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (123 loc) · 3.77 KB
/
main.yml
File metadata and controls
157 lines (123 loc) · 3.77 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Build
on: push
jobs:
build_angular:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node 12
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Prepare
run: npm ci
- name: Prettier
run: npm run actions:prettier
- name: Build
run: npx ionic build --prod
- name: Unit Tests
run: npm test -- --configuration=ci
- name: E2E Tests
run: npm run e2e -- --configuration=ci
- name: Upload
uses: actions/upload-artifact@v1
with:
name: angular_dist
path: www
deploy_github_pages:
needs: build_angular
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node 12
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Prepare
run: npm ci
- name: Deploy Github Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run actions:deploy
android_build:
needs: build_angular
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
# Setup environment
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
# Build app
- name: Download built webapp
uses: actions/download-artifact@v2
with:
name: angular_dist
path: www
# Install dependencies
- name: Install Capacitor
run: npm install @capacitor/cli
- name: Copy files to native project
run: npx cap sync android
- name: Clean android project
run: android/gradlew --project-dir android clean
- name: Build Android APK
run: |
android/gradlew assembleDebug --project-dir android build
mv android/app/build/outputs/apk/debug/app-debug.apk invite-manager-app-dev.apk
# Publish dev artifacts
- name: Upload dev APK
uses: actions/upload-artifact@v1
with:
name: app-dev
path: invite-manager-app-dev.apk
ios_build:
needs: build_angular
if: github.ref == 'refs/heads/master'
runs-on: [macos-latest]
env:
XC_VERSION: ${{ '11.4' }}
XC_WORKSPACE: ${{ 'ios/App/App.xcworkspace' }}
XC_SCHEME: ${{ 'App' }}
steps:
# Setup environment
- uses: actions/checkout@v2
- name: Select latest Xcode
run: 'sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app'
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Download built webapp
uses: actions/download-artifact@v2
with:
name: angular_dist
path: www
# Install dependencies
- name: Install Capacitor
run: npm install @capacitor/cli
- name: Copy files to native project
run: npx cap sync ios
# - name: Build
# run: /usr/bin/xcodebuild -workspace "$XC_WORKSPACE" -scheme "$XC_SCHEME" generic/platform=iOS -configuration Release archive -archivePath ios/InviteManager.xcarchive -allowProvisioningUpdates