forked from Ashinch/ReadYou
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (81 loc) · 3.15 KB
/
build_commit.yaml
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
name: "Build Commit"
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
- name: Prepare cached external dependencies
uses: actions/cache@v3
with:
key: readyougestalt_external_${{ hashFiles('.github/actions/download-externals-action/download.sh') }}
path: |
external
- name: Download build dependencies
uses: ./.github/actions/download-externals-action
- uses: gradle/[email protected]
- run: gradle testGestaltReleaseUnitTest
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
- name: Prepare cached external dependencies
uses: actions/cache@v3
with:
key: readyougestalt_external_${{ hashFiles('.github/actions/download-externals-action/download.sh') }}
path: |
external
- name: Download build dependencies
uses: ./.github/actions/download-externals-action
- uses: gradle/[email protected]
- run: gradle assembleGestaltRelease
- uses: actions/[email protected]
with:
name: gestalt-${{ github.sha }}
path: app/build/outputs/apk/gestalt/release/*.apk
release:
if: github.ref == 'refs/heads/gestalt'
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout the project
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Delete previous release
uses: dev-drprasad/[email protected]
with:
keep_latest: 0
delete_tag_pattern: latest_build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update the latest_build tag
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git tag -f -m "Latest Build" latest_build
git push -f origin latest_build
- name: Download project artifacts
uses: actions/download-artifact@v3
with:
name: gestalt-${{ github.sha }}
- name: Stage upload directory
run: |
mkdir dist
cp *apk dist/
- name: Upload to Github releases
uses: svenstaro/upload-release-action@v2
with:
tag: latest_build
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: dist/*
overwrite: true