summaryrefslogtreecommitdiffstats
path: root/.github/workflows/android-build.yml
blob: e639e965ab6e2d89bb090f141a22563606fcb67a (plain) (blame)
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
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later

name: 'yuzu-android-build'

on:
  push:
    tags: [ "*" ]

jobs:
  android:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: recursive
          fetch-depth: 0
      - name: Set up JDK 17
        uses: actions/setup-java@v3
        with:
          java-version: '17'
          distribution: 'temurin'
      - name: Set up cache
        uses: actions/cache@v3
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
            ~/.ccache
          key: ${{ runner.os }}-android-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-android-
      - name: Query tag name
        uses: olegtarasov/get-tag@v2.1.2
        id: tagName
      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y ccache apksigner glslang-dev glslang-tools
      - name: Build
        run: ./.ci/scripts/android/build.sh
      - name: Copy and sign artifacts
        env:
          ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
          ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
          ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }}
        run: ./.ci/scripts/android/upload.sh
      - name: Upload
        uses: actions/upload-artifact@v3
        with:
          name: android
          path: artifacts/
  # release steps
  release-android:
    runs-on: ubuntu-latest
    needs: [android]
    if: ${{ startsWith(github.ref, 'refs/tags/') }}
    permissions:
      contents: write
    steps:
      - uses: actions/download-artifact@v3
      - name: Query tag name
        uses: olegtarasov/get-tag@v2.1.2
        id: tagName
      - name: Create release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ steps.tagName.outputs.tag }}
          release_name: ${{ steps.tagName.outputs.tag }}
          draft: false
          prerelease: false
      - name: Upload artifacts
        uses: alexellis/upload-assets@0.2.3
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          asset_paths: '["./**/*.apk","./**/*.aab"]'