From 1220a8ae9db19533153c76a054b4a85b90302aaa Mon Sep 17 00:00:00 2001 From: koalasat Date: Wed, 23 Oct 2024 16:51:33 +0200 Subject: [PATCH] Build tools --- .github/workflows/build.yml | 58 ++++++++++++ .github/workflows/create-release.yml | 71 +++++++++++++++ .gitignore | 128 ++++++++++++++++++++++++++- build.sh | 20 +++++ maintainers.yaml | 11 +++ zapstore.yaml | 8 ++ 6 files changed, 293 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/create-release.yml create mode 100755 build.sh create mode 100644 maintainers.yaml create mode 100644 zapstore.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9dab61c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,58 @@ +name: Test/Build Android + +on: + pull_request: + branches: [master] + push: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + + - name: Cache gradle + uses: actions/cache@v4 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Create keystore.properties + run: touch keystore.properties + + - name: Linter (gradle) + run: ./gradlew ktlintCheck + + - name: Test (gradle) + run: ./gradlew test --no-daemon + + - name: Android Test Report + uses: asadmansr/android-test-report-action@v1.2.0 + if: ${{ always() }} # IMPORTANT: run Android Test Report regardless + + - name: Build APK (gradle) + run: ./gradlew assembleDebug --no-daemon + + - name: Upload APK + uses: actions/upload-artifact@v3 + with: + name: Debug APK + path: app/build/outputs/apk/debug/app-universal-debug.apk + + - name: Upload Test Results + uses: actions/upload-artifact@v3 + with: + name: Build Reports + path: app/build/reports + diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..22f12c6 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,71 @@ +name: Create Release Assets + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + + - name: Cache gradle + uses: actions/cache@v4 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build APK + run: ./gradlew assembleRelease --stacktrace + + - name: Sign free APK + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: app/build/outputs/apk/free/release + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.KEY_ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + env: + # override default build-tools version (29.0.3) -- optional + BUILD_TOOLS_VERSION: "34.0.0" + + - uses: kaisugi/action-regex-match@v1.0.1 + id: regex-match + with: + text: ${{ github.ref }} + regex: '(v*-pre*)' + flags: gm + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: ${{ steps.regex-match.outputs.match != '' }} + + - name: Upload Free APK Universal Asset + id: upload-free-release-asset-universal-apk + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: app/build/outputs/apk/release/app-universal-release-unsigned-signed.apk + asset_name: amber-fdroid-universal-${{ github.ref_name }}.apk + asset_content_type: application/zip diff --git a/.gitignore b/.gitignore index aa724b7..9f1f8ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -*.iml -.gradle /local.properties /.idea/caches /.idea/libraries @@ -7,9 +5,133 @@ /.idea/workspace.xml /.idea/navEditor.xml /.idea/assetWizardSettings.xml +/.idea/androidTestResultsUserPreferences.xml +/.idea/deploymentTargetDropDown.xml +/.idea/deploymentTargetSelector.xml +/.idea/other.xml .DS_Store /build /captures -.externalNativeBuild .cxx +.kotlin/ +keystore.properties +/free/ +/offline/ +app/free/release/ +app/play/release/ +app/offline/release/ + +# Built application files +*.apk +*.aar +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ + +# Gradle files +.gradle +.gradle/ +build/ + +# Local configuration file (sdk path, etc) local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio +/*/build/ +/*/local.properties +/*/out +/*/*/build +/*/*/production +captures/ +.navigation/ +*.ipr +*~ +*.swp + +# IntelliJ +*.iml +*.iws +/out/ +deploymentTargetDropdown.xml +render.experimental.xml + +# User-specific configurations +.idea/**/caches/ +.idea/**/libraries/ +.idea/**/shelf/ +.idea/**/codeStyles +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/.name +.idea/**/compiler.xml +.idea/**/copyright/profiles_settings.xml +.idea/**/encodings.xml +.idea/**/misc.xml +.idea/**/modules.xml +.idea/**/scopes/scope_settings.xml +.idea/**/dictionaries +.idea/**/vcs.xml +.idea/**/jsLibraryMappings.xml +.idea/**/datasources.xml +.idea/**/dataSources.ids +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/assetWizardSettings.xml +.idea/**/gradle.xml +.idea/**/jarRepositories.xml +.idea/**/navEditor.xml + +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild +.cxx/ + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md + +# Version control +vcs.xml + +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ +quartz/ +/.idea/other.xml diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..bd20d15 --- /dev/null +++ b/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +version=$1 +appName=$2 + +./gradlew clean bundleRelease --stacktrace +./gradlew assembleRelease --stacktrace +rm ~/release/pokey-* +rm ~/release/citrine-* +rm ~/release/manifest-* +mv app/build/outputs/bundle/release/app-release.aab ~/release/ +mv app/build/outputs/apk/release/app-* ~/release/ +./gradlew --stop +cd ~/release +./generate_manifest.sh ${version} ${appName} diff --git a/maintainers.yaml b/maintainers.yaml new file mode 100644 index 0000000..aef3980 --- /dev/null +++ b/maintainers.yaml @@ -0,0 +1,11 @@ +maintainers: + - npub1v3tgrwwsv7c6xckyhm5dmluc05jxd4yeqhpxew87chn0kua0tjzqc6yvjh +relays: + - wss://nos.lol/ + - wss://relay.damus.io/ + - wss://relay.mostr.pub/ + - wss://nostr.satstralia.com/ + - wss://offchain.pub/ + - wss://relay.snort.social/ + - wss://relay.nsec.app/ + - wss://relay.0xchat.com/ \ No newline at end of file diff --git a/zapstore.yaml b/zapstore.yaml new file mode 100644 index 0000000..b057142 --- /dev/null +++ b/zapstore.yaml @@ -0,0 +1,8 @@ +amber: + android: + identifier: com.kolasat.pokey + name: Pokey + description: Nostr pull notifications on Android. Receive live notification on your events and allow other app the receive and interact with them. + repository: https://github.com/koalasat/pokey + artifacts: + - pokey-arm64-v8a-v%v.apk