From 035506a5a376ac799db47d43ebb73a816c65aea6 Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Mon, 30 Jun 2025 16:04:38 +0200 Subject: [PATCH 1/3] add nonet to release workflow --- .github/workflows/release-net.yml | 22 +++++- .github/workflows/release.yml | 127 ++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release-net.yml b/.github/workflows/release-net.yml index 982b44c4..ce2d07ac 100644 --- a/.github/workflows/release-net.yml +++ b/.github/workflows/release-net.yml @@ -83,8 +83,6 @@ jobs: run: | make manifestlink Flavor=Net - - - name: Build APK (net) env: KeyStore: "${{ github.workspace }}/kp2a.keystore" @@ -93,6 +91,22 @@ jobs: run: | make Configuration=Release Flavor=Net + + - name: Install NuGet dependencies (nonet) + run: make nuget Flavor=NoNet + + - name: Use the _nonet manifest + run: | + make manifestlink Flavor=NoNet + + - name: Build APK (NoNet) + env: + KeyStore: "${{ github.workspace }}/kp2a.keystore" + MyAndroidSigningStorePass: ${{ secrets.KEY_STORE_PASSWORD }} + MyAndroidSigningKeyPass: ${{ secrets.KEY_PASSWORD }} + run: | + make Configuration=Release Flavor=NoNet + - name: List files shell: bash run: | @@ -101,11 +115,11 @@ jobs: - name: Archive production artifacts (net) uses: actions/upload-artifact@v4 with: - name: signed APK ('net' built on ${{ github.job }}) + name: signed APKs (built on ${{ github.job }}) path: | src/keepass2android-app/bin/Release/net8.0-android/*-Signed.apk - - name: Upload APK to GitHub Release + - name: Upload APKs to GitHub Release uses: softprops/action-gh-release@v2 if: github.ref_type == 'tag' with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..66ffd6aa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,127 @@ +name: Create keepass2android release +env: + NAME: 'ReleaseNet' + +on: + release: + types: [published] # Trigger when a new GitHub release is published + workflow_dispatch: # For manual testing + +jobs: + + build-release: + + runs-on: windows-2022 + + + + steps: + + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Extract key store + env: + KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} + KeyStore: "${{ github.workspace }}/kp2a.keystore" + + shell: bash + run: | + echo $KeyStore + echo $KEYSTORE_BASE64 | base64 --decode > $KeyStore + + + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj', 'src/**/packages.config') }} + restore-keys: | + ${{ runner.os }}-nuget- + + # Workaround an issue when building on windows-2022. Error was + # D8 : OpenJDK 64-Bit Server VM warning : INFO: os::commit_memory(0x00000000ae400000, 330301440, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455) [D:\a\keepass2android\keepass2android\src\keepass2android\keepass2android-app.csproj] + # C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.D8.targets(81,5): error MSB6006: "java.exe" exited with code 1. [D:\a\keepass2android\keepass2android\src\keepass2android\keepass2android-app.csproj] + - name: Configure Pagefile + uses: al-cheb/configure-pagefile-action@a3b6ebd6b634da88790d9c58d4b37a7f4a7b8708 # v1.4 + with: + minimum-size: 8GB + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + # If we want to also have nmake, use this instead + #uses: ilammy/msvc-dev-cmd@v1 + + - name: Switch to JDK-17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Display java version + run: java -version + + - name: Build native dependencies + shell: cmd + run: | + make native + + - name: Build java dependencies + shell: cmd + run: | + make java + + - name: Install NuGet dependencies (net) + run: make nuget Flavor=Net + + - name: Use the _net manifest + run: | + make manifestlink Flavor=Net + + - name: Build APK (net) + env: + KeyStore: "${{ github.workspace }}/kp2a.keystore" + MyAndroidSigningStorePass: ${{ secrets.KEY_STORE_PASSWORD }} + MyAndroidSigningKeyPass: ${{ secrets.KEY_PASSWORD }} + run: | + make Configuration=Release Flavor=Net + + + - name: Install NuGet dependencies (nonet) + run: make nuget Flavor=NoNet + + - name: Use the _nonet manifest + run: | + make manifestlink Flavor=NoNet + + - name: Build APK (NoNet) + env: + KeyStore: "${{ github.workspace }}/kp2a.keystore" + MyAndroidSigningStorePass: ${{ secrets.KEY_STORE_PASSWORD }} + MyAndroidSigningKeyPass: ${{ secrets.KEY_PASSWORD }} + run: | + make Configuration=Release Flavor=NoNet + + - name: List files + shell: bash + run: | + ls src/keepass2android-app/bin/**/*.* + + - name: Archive production artifacts (net) + uses: actions/upload-artifact@v4 + with: + name: signed APK (built on ${{ github.job }}) + path: | + src/keepass2android-app/bin/Release/net8.0-android/*-Signed.apk + + - name: Upload APK to GitHub Release + uses: softprops/action-gh-release@v2 + if: github.ref_type == 'tag' + with: + files: | + src/keepass2android-app/bin/Release/net8.0-android/*-Signed.apk From c78636264b05cbf35223e4da20f62a9a20be826e Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Mon, 30 Jun 2025 16:05:02 +0200 Subject: [PATCH 2/3] align net and nonet manifests --- .../Manifests/AndroidManifest_net.xml | 25 +-- .../Manifests/AndroidManifest_nonet.xml | 188 +++++++++--------- 2 files changed, 103 insertions(+), 110 deletions(-) diff --git a/src/keepass2android-app/Manifests/AndroidManifest_net.xml b/src/keepass2android-app/Manifests/AndroidManifest_net.xml index 02d57ef9..a212ec94 100644 --- a/src/keepass2android-app/Manifests/AndroidManifest_net.xml +++ b/src/keepass2android-app/Manifests/AndroidManifest_net.xml @@ -1,10 +1,10 @@  + android:versionCode="212" + android:versionName="1.12-r8" + package="keepass2android.keepass2android" + xmlns:tools="http://schemas.android.com/tools" + android:installLocation="auto"> @@ -46,13 +46,11 @@ - + android:icon="@mipmap/ic_launcher_online" + android:roundIcon="@mipmap/ic_launcher_online_round" + android:networkSecurityConfig="@xml/network_security_config" + > - - + diff --git a/src/keepass2android-app/Manifests/AndroidManifest_nonet.xml b/src/keepass2android-app/Manifests/AndroidManifest_nonet.xml index cf2d83cc..4c0c2c51 100644 --- a/src/keepass2android-app/Manifests/AndroidManifest_nonet.xml +++ b/src/keepass2android-app/Manifests/AndroidManifest_nonet.xml @@ -1,24 +1,27 @@  - - - + + + - + + + + + + + + + - - - - - @@ -36,59 +39,57 @@ - - - - - + + + + + - + - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -98,11 +99,11 @@ - + - + @@ -112,7 +113,7 @@ - - + @@ -168,7 +169,7 @@ The scheme=file is still there for old OS devices. It's also queried by apps lik - + @@ -218,24 +219,15 @@ The scheme=file is still there for old OS devices. It's also queried by apps lik - - - - + + + + + + + + - - - - - - - - - - @@ -244,24 +236,28 @@ The scheme=file is still there for old OS devices. It's also queried by apps lik - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - From 7dd80a8ef761ff217ef95a2e74b4697ca8a134bc Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Mon, 30 Jun 2025 16:16:55 +0200 Subject: [PATCH 3/3] remove "net" where no longer appropriate from workflow file --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66ffd6aa..dbeaf6d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ name: Create keepass2android release env: - NAME: 'ReleaseNet' + NAME: 'Release' on: release: @@ -112,7 +112,7 @@ jobs: run: | ls src/keepass2android-app/bin/**/*.* - - name: Archive production artifacts (net) + - name: Archive production artifacts uses: actions/upload-artifact@v4 with: name: signed APK (built on ${{ github.job }})