-
Notifications
You must be signed in to change notification settings - Fork 25
135 lines (128 loc) · 4.02 KB
/
gradle.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
124
125
126
127
128
129
130
131
132
133
134
135
name: Javascript CI
on:
push:
branches:
- '**'
tags:
- '**'
pull_request:
branches:
- '**'
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install
- name: Check Prettier format
run: yarn format:check
- name: Check EsLint issues
run: yarn lint
build:
name: Build & APK generation
runs-on: ubuntu-latest
needs: format
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install
- name: Provide permission for execution
run: chmod +x android/gradlew
- name: Check packages
run: yarn build
- name: Check Android build
run: cd android && ./gradlew app:assemblePipelineRelease
- name: Rename APK
run: mv android/app/build/outputs/apk/pipeline/release/app-pipeline-release.apk android/app/build/outputs/apk/pipeline/release/${{ github.head_ref || github.ref_name }}.apk
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: ${{ github.head_ref || github.ref_name }}.apk
path: android/app/build/outputs/apk/pipeline/release/${{ github.head_ref || github.ref_name }}.apk
test:
name: Test
runs-on: ubuntu-latest
needs: format
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Test application
run: yarn && yarn build && yarn test
check-license-lines:
name: Check AGPL license header
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@main
with:
deno-version: v1.x
- name: check-license
run: deno run --allow-read https://deno.land/x/[email protected]/main.ts
create-tag-release:
needs: [format, build, check-license-lines]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
name: Release tag
runs-on: 'ubuntu-latest'
steps:
- name: Download site content
uses: actions/download-artifact@v2
with:
name: ${{ github.head_ref || github.ref_name }}.apk
- name: Create GitHub release
id: create-new-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./${{ github.head_ref || github.ref_name }}.apk
asset_name: aom-${{ github.ref_name }}.apk
asset_content_type: application/vnd.android.package-archive
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install
- name: Check packages
run: yarn build
- name: Publish packages
run: yarn release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}