128 lines
3.7 KiB
YAML
128 lines
3.7 KiB
YAML
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 APKs (built on ${{ github.job }})
|
|
path: |
|
|
src/keepass2android-app/bin/Release/net8.0-android/*-Signed.apk
|
|
|
|
- name: Upload APKs 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
|