|
21 | 21 | env: |
22 | 22 | ORIGINAL_PROJECT: "CeuiLiSA/Pixiv-Shaft" |
23 | 23 |
|
| 24 | +concurrency: |
| 25 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 26 | + cancel-in-progress: true |
| 27 | + |
24 | 28 | jobs: |
25 | 29 | build: |
26 | 30 | name: Build apk |
27 | 31 | runs-on: ubuntu-24.04 |
28 | 32 | steps: |
29 | | - - name: Cancel previous runs |
30 | | - uses: styfle/cancel-workflow-action@0.5.0 |
31 | | - with: |
32 | | - access_token: ${{ github.token }} |
33 | | - |
34 | 33 | - name: Clone repo |
35 | 34 | uses: actions/checkout@v4 |
36 | 35 | with: |
37 | 36 | submodules: 'true' |
38 | 37 | fetch-depth: 0 |
39 | 38 |
|
40 | | - - name: set up JDK 21 |
| 39 | + - name: Set up JDK 21 |
41 | 40 | uses: actions/setup-java@v4.2.2 |
42 | 41 | with: |
43 | 42 | java-version: '21' |
44 | 43 | distribution: 'adopt' |
45 | 44 |
|
| 45 | + - name: Set up Gradle |
| 46 | + uses: gradle/actions/setup-gradle@v3 |
| 47 | + |
46 | 48 | - name: Grant execute permission for gradlew |
47 | 49 | run: chmod +x gradlew |
48 | 50 |
|
49 | 51 | - name: Build debug apk |
50 | | - uses: eskatos/gradle-command-action@v1 |
51 | | - with: |
52 | | - arguments: assembleDebug |
53 | | - distributions-cache-enabled: true |
54 | | - dependencies-cache-enabled: true |
55 | | - configuration-cache-enabled: true |
| 52 | + run: ./gradlew assembleDebug |
56 | 53 |
|
57 | 54 | - name: Upload artifact |
58 | | - uses: actions/upload-artifact@v4 |
59 | 55 | if: ${{ !github.head_ref }} |
| 56 | + uses: actions/upload-artifact@v4 |
60 | 57 | with: |
61 | 58 | name: apk-debug |
62 | 59 | path: app/build/outputs/apk/debug |
|
73 | 70 |
|
74 | 71 | - name: Build release apk |
75 | 72 | if: startsWith(github.ref, 'refs/tags/') && github.repository == env.ORIGINAL_PROJECT |
76 | | - uses: eskatos/gradle-command-action@v1 |
77 | | - with: |
78 | | - arguments: assembleRelease |
79 | | - distributions-cache-enabled: true |
80 | | - dependencies-cache-enabled: true |
81 | | - configuration-cache-enabled: true |
| 73 | + run: ./gradlew assembleRelease |
82 | 74 |
|
83 | 75 | - name: Deal with release apk |
84 | 76 | if: startsWith(github.ref, 'refs/tags/') && github.repository == env.ORIGINAL_PROJECT |
|
0 commit comments