diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..9f2497a --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,65 @@ +name: Build dev test build +permissions: write-all +on: + push: + branches: + - dev + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + APP_VERSION=$(grep 'app-versionName' gradle/libs.versions.toml | sed 's/.*= "\(.*\)"/\1/') + echo "RELEASE_VERSION=$APP_VERSION" >> $GITHUB_ENV + - name: Set up JDK env + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 19 + cache: 'gradle' + + - name: Execute Gradle build + run: ./gradlew --no-daemon --build-cache assembleRelease + + - name: Get build tools + run: | + BUILD_TOOLS_PATH=/usr/local/lib/android/sdk/build-tools/$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) + echo "BUILD_TOOLS=$BUILD_TOOLS_PATH" >> $GITHUB_ENV + + - name: Zipalign the APK + run: | + $BUILD_TOOLS/zipalign -v 4 app/build/outputs/apk/release/app-release-unsigned.apk app-release-unsigned.apk + + - name: Sign the APK + run: | + echo "${{ secrets.KEYSTORE }}" > keystore.asc + gpg -d --passphrase "${{ secrets.KEY_PASSWD }}" --batch keystore.asc > keystore.jks + $BUILD_TOOLS/apksigner sign --ks keystore.jks --ks-key-alias ${{ secrets.KEY_ALIAS }} --ks-pass pass:${{ secrets.KEY_PASSWD }} --key-pass pass:${{ secrets.KEY_PASSWD }} --out app-release.apk app-release-unsigned.apk + + - name: Verify the APK signature + run: $BUILD_TOOLS/apksigner verify app-release.apk + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.RELEASE_VERSION }} + release_name: Release ${{ env.RELEASE_VERSION }} + draft: false + prerelease: true + + - name: Upload release 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-release.apk + asset_name: linklater-release.apk + asset_content_type: application/vnd.android.package-archive + + diff --git a/app/src/main/java/org/yrovas/linklater/ui/activity/AppActivity.kt b/app/src/main/java/org/yrovas/linklater/ui/activity/AppActivity.kt index 029991e..e26cbad 100644 --- a/app/src/main/java/org/yrovas/linklater/ui/activity/AppActivity.kt +++ b/app/src/main/java/org/yrovas/linklater/ui/activity/AppActivity.kt @@ -55,7 +55,6 @@ abstract class AppActivity : ComponentActivity() { endpoint = component.prefStore.getPref(Prefs.LINKDING_URL, ""), token = component.prefStore.getPref(Prefs.LINKDING_TOKEN, ""), ) - delay(3000) _setup_complete.update { true } } setContent {