From 723c7e9aec1fb5cb2c40514993be9131fbc229ee Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 2 Apr 2022 10:33:12 -0400 Subject: Upgrade CI workflow (#111) * Cache dependencies on CI workflow * Use available fontforge version for CI action Avoid a dirty OS upgrade to get a newer version of FontForge, use what is available at Ubuntu 20.04 * Upgrade CI Workflow By using an appimage of FontForge, it's easier to install the latest version, to cache it, and there is no extra dependencies clashes with Ubuntu 20.04 * Make paths for fontforge absolute in makefile It's necessary because fontforge is an AppImage and requires it * Improve cache step on CI wget don't download a duplicate if file already exists * Generate base64 ascii encoded debug keystore That can be used to transfer the keystore to a Github Secret * Restore debug.keystore from github secrets Get the asc encoded keystore from github secrets, and decode it back to a bynary file inside the CI run. * Cleanup redundant lines and add explanation comment * runs-on ubuntu-latest Co-authored-by: Jules Aguillon * add *.keystore.asc to .gitignore * Clean up lines, adjust documentation * use CURDIR automatic makefile variable Co-authored-by: Jules Aguillon --- .github/workflows/make-apk.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to '.github') diff --git a/.github/workflows/make-apk.yml b/.github/workflows/make-apk.yml index fa097b2..6457576 100644 --- a/.github/workflows/make-apk.yml +++ b/.github/workflows/make-apk.yml @@ -9,17 +9,19 @@ jobs: Build-Apk: runs-on: ubuntu-latest steps: - - name: Install nix - uses: cachix/install-nix-action@v15 - with: - nix_path: nixpkgs=channel:nixos-unstable - - name: Cache Nix store + - name: Cache fontforge and extra dependencies uses: actions/cache@v2 with: - path: /nix - key: nix-store - - name: Install external dependencies - run: nix-env -f '' -i fontforge + 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 @@ -31,6 +33,19 @@ jobs: 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 -- cgit v1.2.3