abouttreesummaryrefslogcommitdiff
path: root/.github/workflows/make-apk.yml
blob: 64575762e966757bda54e78b9236f264986d8fa8 (plain)
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
name: Make Apk CI

on:
  workflow_dispatch:
  push:
  pull_request:

jobs:
  Build-Apk:
    runs-on: ubuntu-latest
    steps:
    - name: Cache fontforge and extra dependencies
      uses: actions/cache@v2
      with:
        path: /usr/local/bin
        key: usr-local-bin
    - name: Install latest FontForge version (using AppImage)
      run: |
        # Get most recent version of FontForge
        # Using AppImage there is no dependecy problem, it is the latest version and it's easier to cache
        cd /usr/local/bin
        sudo wget -c -N https://github.com/fontforge/fontforge/releases/download/20220308/FontForge-2022-03-08-582bd41-x86_64.AppImage
        sudo chmod +x ./FontForge-2022-03-08-582bd41-x86_64.AppImage
        sudo ln --symbolic --force /usr/local/bin/FontForge-2022-03-08-582bd41-x86_64.AppImage /usr/local/bin/fontforge
    - uses: actions/setup-java@v2
      with:
        distribution: 'zulu' # See 'Supported distributions' for available options
        java-version: '11'
    - name: Checkout repo
      uses: actions/checkout@v2
    - name: Cache debug certificate
      uses: actions/cache@v2
      with:
        path: _build/debug.keystore
        key: debug-keystore
    - name: Restore debug keystore from github Secrets 
      run: |
        mkdir -p _build
        cd "$GITHUB_WORKSPACE/_build"
        # Check if exist and use the secret named DEBUG_KEYSTORE
        # The contents of the secret can be obtained -
        #    from the debug.keystore.asc from you local _build folder
        if [[ ! "${{ secrets.DEBUG_KEYSTORE }}" == "" ]]; then
            echo "${{ secrets.DEBUG_KEYSTORE }}" > "debug.keystore.asc"
            if [[ -s "debug.keystore.asc" ]]; then
                gpg -d --passphrase "debug0" --batch "debug.keystore.asc" > "debug.keystore"
            fi
        fi
    - name: Build
      run: make
    - name: Save debug apk
      uses: actions/upload-artifact@v2
      with:
        name: debug apk
        path: _build/*.apk