Upload Artifacts #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Artifacts | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: false | |
type: string | |
default: "nightly" | |
workflow_call: | |
inputs: | |
version: | |
required: true | |
type: string | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- run: | | |
git clone https://github.com/wiiznokes/libgit2-android --depth=1 --branch=patch-android | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
cache: gradle | |
# https://github.com/actions/cache/blob/main/examples.md#java---gradle | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Retrieve the secret and decode it to a file | |
env: | |
KEY_BASE64: ${{ secrets.KEY_BASE64 }} | |
run: | | |
echo $KEY_BASE64 | base64 --decode > app/key.jks | |
# todo: specifie arch | |
- name: Build apk | |
env: | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
STORE_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
run: | | |
./gradlew assembleRelease | |
- run: | | |
mkdir -p packages | |
# warning: do not use github.event syntax here | |
# https://stackoverflow.com/questions/71458189/github-action-workflow-call-does-not-use-up-to-date-input-values | |
mv app/build/outputs/apk/release/app-release.apk packages/gitnote-release-${{ inputs.version }}.apk | |
# when downloading, this will be: pathdest/name/filename | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: releases | |
path: packages/* | |
if-no-files-found: error |