Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Nightly

Nightly #200

Workflow file for this run

name: Nightly
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup app version
run: |
sed -i "s/versionCode = [0-9]\+/versionCode = $GITHUB_RUN_NUMBER/" app/build.gradle.kts
sed -i "s/versionName = \"[^\"]\+\"/versionName = \"0.0.0-nightly+git-$(git rev-parse --short HEAD)\"/" app/build.gradle.kts
- name: Build with Gradle
run: ./gradlew build
- name: Sign APK
id: sign_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Prepare release
run: |
mkdir release
cp ${{ steps.sign_apk.outputs.signedReleaseFile }} release/LibrePass-signed.apk
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: apk
path: release/*
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download APK from build
uses: actions/download-artifact@v3
with:
name: apk
path: apk
- name: Delete tag and release
uses: ClementTsang/[email protected]
if: github.event.inputs.isMock != 'mock'
with:
delete_release: true
tag_name: nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sleep for a few seconds to prevent timing issues between the deletion and creation of the release
run: sleep 10
- name: Create release
uses: softprops/[email protected]
if: github.event.inputs.isMock != 'mock'
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
tag_name: "nightly"
draft: false
fail_on_unmatched_files: true
files: apk/*