run fdroid build on ubuntu 24.04 #14
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
FRAMEWORK: net8.0-android | |
CONFIGURATION: Release | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Android workload | |
run: dotnet workload install android | |
- name: Install Android platform tools | |
run: $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install platform-tools | |
- name: Prepare keystore | |
run: | | |
echo "${{ secrets.KEYSTORE }}" | base64 -d > "$GITHUB_WORKSPACE/keystore.jks" | |
- name: Build Android APK | |
run: | | |
python extra/build.py android apk --branch "${{ github.ref_name }}" --keystore "$GITHUB_WORKSPACE/keystore.jks" --keystore-pass "${{ secrets.KEYSTORE_PASS }}" --keystore-alias "${{ secrets.KEYSTORE_ALIAS }}" --keystore-key-pass "${{ secrets.KEYSTORE_KEY_PASS }}" | |
- name: Build Android APK (F-Droid) | |
run: | | |
python extra/build.py android apk --branch "${{ github.ref_name }}" --fdroid --keystore "$GITHUB_WORKSPACE/keystore.jks" --keystore-pass "${{ secrets.KEYSTORE_PASS }}" --keystore-alias "${{ secrets.KEYSTORE_ALIAS }}" --keystore-key-pass "${{ secrets.KEYSTORE_KEY_PASS }}" | |
- name: Build Android AAB | |
run: | | |
python extra/build.py android aab --branch "${{ github.ref_name }}" --keystore "$GITHUB_WORKSPACE/keystore.jks" --keystore-pass "${{ secrets.KEYSTORE_PASS }}" --keystore-alias "${{ secrets.KEYSTORE_ALIAS }}" --keystore-key-pass "${{ secrets.KEYSTORE_KEY_PASS }}" | |
- name: Build Wear OS APK | |
run: | | |
python extra/build.py wearos apk --branch "${{ github.ref_name }}" --keystore "$GITHUB_WORKSPACE/keystore.jks" --keystore-pass "${{ secrets.KEYSTORE_PASS }}" --keystore-alias "${{ secrets.KEYSTORE_ALIAS }}" --keystore-key-pass "${{ secrets.KEYSTORE_KEY_PASS }}" | |
- name: Build Wear OS AAB | |
run: | | |
python extra/build.py wearos aab --branch "${{ github.ref_name }}" --keystore "$GITHUB_WORKSPACE/keystore.jks" --keystore-pass "${{ secrets.KEYSTORE_PASS }}" --keystore-alias "${{ secrets.KEYSTORE_ALIAS }}" --keystore-key-pass "${{ secrets.KEYSTORE_KEY_PASS }}" | |
- name: Upload APK as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Stratum (APK) | |
path: out/*.apk | |
- name: Upload AAB as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Stratum (AAB) | |
path: out/*.aab | |
- name: Get changelog | |
run: | | |
VERSION_CODE=$(cat Stratum.Droid/Properties/AndroidManifest.xml | grep android:versionCode | sed -rn 's/.*versionCode="(.*)".*/\1/p') | |
CHANGELOG_PATH="fastlane/metadata/android/en-US/changelogs/$VERSION_CODE.txt" | |
echo "CHANGELOG_PATH=$CHANGELOG_PATH" >> $GITHUB_ENV | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
out/com.stratumauth.app-arm64-v8a.fdroid.apk | |
out/com.stratumauth.app-armeabi-v7a.fdroid.apk | |
out/com.stratumauth.app-x86.fdroid.apk | |
out/com.stratumauth.app-x86_64.fdroid.apk | |
out/com.stratumauth.app.apk | |
out/com.stratumauth.app.fdroid.apk | |
out/com.stratumauth.app.wearos.apk | |
token: "${{ secrets.GH_TOKEN }}" | |
discussion_category_name: "General" | |
body_path: "${{ env.CHANGELOG_PATH }}" | |
draft: true | |
fdroid: | |
runs-on: ubuntu-24.04 | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install F-Droid server | |
run: | | |
sudo add-apt-repository -y ppa:fdroid/fdroidserver | |
sudo apt-get -qq update | |
sudo apt-get -yqq install fdroidserver | |
- name: Prepare config | |
run: | | |
echo "keystorepass: '${{ secrets.KEYSTORE_PASS }}'" >> "$GITHUB_WORKSPACE/fdroid/config.yml" | |
echo "keypass: '${{ secrets.KEYSTORE_KEY_PASS }}'" >> "$GITHUB_WORKSPACE/fdroid/config.yml" | |
echo "repo_keyalias: '${{ secrets.KEYSTORE_ALIAS }}'" >> "$GITHUB_WORKSPACE/fdroid/config.yml" | |
echo "${{ secrets.KEYSTORE }}" | base64 -d > "$GITHUB_WORKSPACE/fdroid/keystore.jks" | |
chmod 600 "$GITHUB_WORKSPACE/fdroid/config.yml" | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: "Stratum (APK)" | |
- name: Update repo | |
run: | | |
mkdir "$GITHUB_WORKSPACE/fdroid/repo" | |
mv com.stratumauth.app.fdroid.apk "$GITHUB_WORKSPACE/fdroid/repo/com.stratumauth.app.apk" | |
pushd "$GITHUB_WORKSPACE/fdroid" | |
fdroid update | |
popd | |
- name: Deploy with rsync | |
uses: burnett01/[email protected] | |
with: | |
switches: -avzr --delete | |
path: "fdroid/repo" | |
remote_path: /var/www/fdroid | |
remote_host: ${{ secrets.DEPLOY_HOST }} | |
remote_user: ${{ secrets.DEPLOY_USER }} | |
remote_key: ${{ secrets.DEPLOY_KEY }} |