-
-
Notifications
You must be signed in to change notification settings - Fork 92
76 lines (74 loc) · 2.55 KB
/
default.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
name: default
on:
push:
pull_request:
permissions:
pull-requests: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install ktlint
run: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.48.2/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
- name: run ktlint
run: |
ktlint --reporter=checkstyle,output=build/ktlint-report.xml
continue-on-error: true
- uses: yutailang0119/action-ktlint@v3
with:
report-path: build/*.xml # Support glob patterns by https://www.npmjs.com/package/@actions/glob
continue-on-error: false # If annotations contain error of severity, action-ktlint exit 1.
build-debug-apk:
needs: [lint]
if: github.event_name == 'pull_request'
uses: ./.github/workflows/build-apk.yml
with:
build-type: debug
secrets:
key-alias: ${{ secrets.DEBUG_KEY_ALIAS }}
keystore: ${{ secrets.DEBUG_KEYSTORE_B64 }}
key-password: ${{ secrets.DEBUG_KEY_PASSWORD }}
post-apk-link:
needs: [build-debug-apk]
runs-on: ubuntu-latest
steps:
- name: Post link to action run detail page
uses: actions/github-script@v6
with:
script: |
const commentResult = await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `APK build completed! Visit [action run detail page](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) to download the APK to test this pull request.`
})
console.log(commentResult)
build-release-apk:
needs: [lint]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/build-apk.yml
with:
build-type: release
secrets:
key-alias: ${{ secrets.KEY_ALIAS }}
keystore: ${{ secrets.KEYSTORE_B64 }}
key-password: ${{ secrets.KEY_PASSWORD }}
release:
needs: [build-release-apk]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download APK
id: download
uses: actions/download-artifact@v3
with:
name: ${{ needs.build-release-apk.outputs.filename }}
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
name: "v${{ github.ref_name }}"
generate_release_notes: true
files: dev.bluehouse.enablevolte.apk