Compare commits

...

11 Commits

Author SHA1 Message Date
Philipp Crocoll
584feabe44 build process: add previously missing change; fix error in build.yml, more verbose output in release.yml 2025-07-05 13:34:01 +02:00
Philipp Crocoll
ae2cfde897 change makefile to no longer use msbuild but always dotnet 2025-07-05 13:10:21 +02:00
Philipp Crocoll
42c66670b8 release process: make find calls to run in bash 2025-07-05 12:12:49 +02:00
Philipp Crocoll
288539b902 make output more verbose 2025-07-05 11:09:55 +02:00
Philipp Crocoll
61fd32f121 avoid building the "full" apk when calling apk_split 2025-07-05 09:39:54 +02:00
Philipp Crocoll
43108ec4a6 remove ls step in release 2025-07-05 08:35:58 +02:00
Philipp Crocoll
51089c6b98 change build artifact release paths. make archive name depend on matrix variables. 2025-07-05 08:16:30 +02:00
Philipp Crocoll
cf18fcf91c remove distclean from build 2025-07-05 08:15:58 +02:00
Philipp Crocoll
da0513c768 don't create release but only list files to test the release workflow without polluting github releases 2025-07-05 07:49:39 +02:00
Philipp Crocoll
37f520cdbe manifest for r9c 2025-07-05 07:40:21 +02:00
Philipp Crocoll
c98572bee0 fix wildcard for selecting files to upload to release 2025-07-05 07:39:44 +02:00
5 changed files with 80 additions and 78 deletions

View File

@@ -78,7 +78,7 @@ jobs:
# - name: Build keepass2android (net) # - name: Build keepass2android (net)
# run: | # run: |
# make msbuild Flavor=Net # make dotnetbuild Flavor=Net
# - name: Build APK (net) # - name: Build APK (net)
# run: | # run: |
@@ -96,7 +96,7 @@ jobs:
# - name: Build keepass2android (nonet) # - name: Build keepass2android (nonet)
# run: | # run: |
# make msbuild Flavor=NoNet # make dotnetbuild Flavor=NoNet
# - name: Build APK (nonet) # - name: Build APK (nonet)
# run: | # run: |
@@ -212,7 +212,7 @@ jobs:
# - name: Build keepass2android (net) # - name: Build keepass2android (net)
# run: | # run: |
# make msbuild Flavor=Net # make dotnetbuild Flavor=Net
# - name: Build APK (net) # - name: Build APK (net)
# run: | # run: |
@@ -230,7 +230,7 @@ jobs:
# - name: Build keepass2android (nonet) # - name: Build keepass2android (nonet)
# run: | # run: |
# make msbuild Flavor=NoNet # make dotnetbuild Flavor=NoNet
# - name: Build APK (nonet) # - name: Build APK (nonet)
# run: | # run: |
@@ -279,7 +279,7 @@ jobs:
with: with:
minimum-size: 8GB minimum-size: 8GB
- name: Add msbuild to PATH - name: Add dotnetbuild to PATH
uses: microsoft/setup-msbuild@v2 uses: microsoft/setup-msbuild@v2
# If we want to also have nmake, use this instead # If we want to also have nmake, use this instead
#uses: ilammy/msvc-dev-cmd@v1 #uses: ilammy/msvc-dev-cmd@v1
@@ -322,7 +322,7 @@ jobs:
- name: Build keepass2android (net) - name: Build keepass2android (net)
run: | run: |
make msbuild Flavor=Net make dotnetbuild Flavor=Net
- name: Build APK (net) - name: Build APK (net)
run: | run: |
@@ -344,7 +344,7 @@ jobs:
- name: Build keepass2android (nonet) - name: Build keepass2android (nonet)
run: | run: |
make msbuild Flavor=NoNet make dotnetbuild Flavor=NoNet
- name: Test Autofill - name: Test Autofill
working-directory: ./src/Kp2aAutofillParser.Tests working-directory: ./src/Kp2aAutofillParser.Tests
@@ -361,5 +361,3 @@ jobs:
path: | path: |
src/keepass2android/bin/*/*-Signed.apk src/keepass2android/bin/*/*-Signed.apk
- name: Perform "make distclean"
run: make distclean

View File

@@ -54,7 +54,7 @@ jobs:
with: with:
minimum-size: 8GB minimum-size: 8GB
- name: Add msbuild to PATH - name: Add msbuild/dotnet to PATH
uses: microsoft/setup-msbuild@v2 uses: microsoft/setup-msbuild@v2
# If we want to also have nmake, use this instead # If we want to also have nmake, use this instead
#uses: ilammy/msvc-dev-cmd@v1 #uses: ilammy/msvc-dev-cmd@v1
@@ -78,17 +78,35 @@ jobs:
run: | run: |
make java make java
- name: List apks
run: find . -type f -name "*.apk"
shell: bash
- name: Update dotnet workloads - name: Update dotnet workloads
run: | run: |
dotnet workload update dotnet workload update
- name: List apks
run: find . -type f -name "*.apk"
shell: bash
- name: Select the manifest - name: Select the manifest
run: | run: |
make manifestlink Flavor=${{ matrix.flavor }} make manifestlink Flavor=${{ matrix.flavor }}
- name: List apks
run: find . -type f -name "*.apk"
shell: bash
- name: Install NuGet dependencies - name: Install NuGet dependencies
run: make nuget Flavor=${{ matrix.flavor }} run: make nuget Flavor=${{ matrix.flavor }}
- name: List apks
run: find . -type f -name "*.apk"
shell: bash
- name: Build APK (net) - name: Build APK (net)
env: env:
KeyStore: "${{ github.workspace }}/kp2a.keystore" KeyStore: "${{ github.workspace }}/kp2a.keystore"
@@ -101,18 +119,26 @@ jobs:
run: | run: |
make ${{ matrix.target }} Configuration=Release Flavor=${{ matrix.flavor }} make ${{ matrix.target }} Configuration=Release Flavor=${{ matrix.flavor }}
- name: List apks
run: find . -type f -name "*.apk"
shell: bash
- name: Archive production artifacts - name: Archive production artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: signed APK (built on ${{ github.job }}) name: keepass2android_${{ matrix.target }}_${{ matrix.flavor }}
path: | path: |
src/keepass2android-app/bin/Release/net8.0-android/*/publish/*.apk src/keepass2android-app/bin/Release/**/publish/*.apk src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk
src/keepass2android-app/bin/Release/net8.0-android/*/publish/*.apk
- name: Upload APK to GitHub Release - name: List apks
uses: softprops/action-gh-release@v2 run: find . -type f -name "*.apk"
if: github.ref_type == 'tag' shell: bash
with:
files: | #- name: Upload APK to GitHub Release
src/keepass2android-app/bin/Release/net8.0-android/*/publish/*.apk src/keepass2android-app/bin/Release/**/publish/*.apk # uses: softprops/action-gh-release@v2
# if: github.ref_type == 'tag'
# with:
# files: |
# src/keepass2android-app/bin/Release/net8.0-android/*/publish/*.apk src/keepass2android-app/bin/Release/net8.0-android/publish/*.apk

View File

@@ -4,10 +4,10 @@
# This Makefile can be used on both unix-like (use make) & windows (with GNU make) # This Makefile can be used on both unix-like (use make) & windows (with GNU make)
# #
# append the Configuration variable to 'make' call with value to use in '/p:Configuration=' # append the Configuration variable to 'make' call with value to use in '/p:Configuration='
# of msbuild command. # of dotnetbuild command.
# #
# append the Flavor variable to 'make' call with value to use in '/p:Flavor=' # append the Flavor variable to 'make' call with value to use in '/p:Flavor='
# of msbuild command. # of dotnetbuild command.
# #
# Example: # Example:
# make Configuration=Release Flavor=NoNet # make Configuration=Release Flavor=NoNet
@@ -18,7 +18,7 @@
# - native: build the native libs # - native: build the native libs
# - java: build the java libs # - java: build the java libs
# - nuget: restore NuGet packages # - nuget: restore NuGet packages
# - msbuild: build the project # - dotnetbuild: build the project
# - apk: same as all # - apk: same as all
# - manifestlink: creates a symlink (to be used in building) to the AndroidManifest corresponding to the selected Flavor # - manifestlink: creates a symlink (to be used in building) to the AndroidManifest corresponding to the selected Flavor
# #
@@ -27,7 +27,7 @@
# - clean_native: clean native lib # - clean_native: clean native lib
# - clean_java: call clean target of java libs # - clean_java: call clean target of java libs
# - clean_nuget: cleanup the 'nuget restore' # - clean_nuget: cleanup the 'nuget restore'
# - clean_msbuild: call clean target of msbuild # - clean_dotnet: call clean target of dotnetbuild
# #
# #
# #
@@ -60,45 +60,23 @@ $(info MAKESHELL: $(MAKESHELL))
$(info SHELL: $(SHELL)) $(info SHELL: $(SHELL))
$(info ) $(info )
# On linux use xabuild, on Windows use MSBuild.exe, otherwise (macos?) use msbuild.
ifeq ($(detected_OS),Linux) ifeq ($(detected_OS),Linux)
MSBUILD_binary := dotnet DOTNET_binary := dotnet
MSBUILD := $(shell $(WHICH) $(MSBUILD_binary)) publish DOTNET := $(shell $(WHICH) $(DOTNET_binary))
else ifeq ($(detected_OS),Windows) else ifeq ($(detected_OS),Windows)
MSBUILD_binary := dotnet DOTNET_binary := dotnet
MSBUILD := $(shell $(WHICH) $(MSBUILD_binary) 2> nul) publish DOTNET := $(shell $(WHICH) $(DOTNET_binary) 2> nul)
ifeq ($(MSBUILD),)
# Additional heuristic to find MSBUILD_BINARY on Windows
VSWHERE := "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
VSWHERE_CHECK := $(shell @echo off & $(VSWHERE) 2> nul || echo VSWHERE_NOT_FOUND)
ifneq ($(VSWHERE_CHECK),VSWHERE_NOT_FOUND)
MSBUILD := $(shell @echo off & $(VSWHERE) -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe)
VS_INSTALL_PATH := $(shell @echo off & $(VSWHERE) -property installationPath)
endif
endif
else else
MSBUILD_binary := msbuild DOTNET_binary := dotnet
MSBUILD := $(shell $(WHICH) $(MSBUILD_binary)) DOTNET := $(shell $(WHICH) $(DOTNET_binary))
endif endif
ifeq ($(MSBUILD),) ifeq ($(DOTNET),)
$(info ) $(info )
$(info '$(MSBUILD_binary)' binary could not be found. Check it is in your PATH.) $(info '$(DOTNET_binary)' binary could not be found. Check it is in your PATH.)
ifeq ($(detected_OS),Windows)
ifneq ($(VSWHERE_CHECK),VSWHERE_NOT_FOUND)
$(info )
$(info You may retry after running in the command prompt:)
$(info )
$(info "$(VS_INSTALL_PATH)\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64)
$(info )
$(info If this doesn't work, install/find the location of vcvarsall.bat)
$(info or install and add msbuild.exe to your PATH)
$(info )
endif
endif
$(error ) $(error )
endif endif
$(info MSBUILD: $(MSBUILD)) $(info DOTNET: $(DOTNET))
$(info ) $(info )
ifeq ($(ANDROID_SDK_ROOT),) ifeq ($(ANDROID_SDK_ROOT),)
@@ -117,7 +95,7 @@ endif
$(info ANDROID_NDK_ROOT: $(ANDROID_NDK_ROOT)) $(info ANDROID_NDK_ROOT: $(ANDROID_NDK_ROOT))
ifneq ($(Configuration),) ifneq ($(Configuration),)
MSBUILD_PARAM = -p:Configuration="$(Configuration)" DOTNET_PARAM = -p:Configuration="$(Configuration)"
else else
$(warning Configuration environment variable not set.) $(warning Configuration environment variable not set.)
endif endif
@@ -127,7 +105,7 @@ CREATE_MANIFEST_LINK :=
MANIFEST_FILE := MANIFEST_FILE :=
ifneq ($(Flavor),) ifneq ($(Flavor),)
MSBUILD_PARAM += -p:Flavor="$(Flavor)" DOTNET_PARAM += -p:Flavor="$(Flavor)"
ifneq ($(Flavor),) ifneq ($(Flavor),)
ifeq ($(Flavor),Debug) ifeq ($(Flavor),Debug)
MANIFEST_FILE := AndroidManifest_debug.xml MANIFEST_FILE := AndroidManifest_debug.xml
@@ -152,7 +130,7 @@ else
endif endif
ifneq ($(KeyStore),) ifneq ($(KeyStore),)
MSBUILD_PARAM += -p:AndroidKeyStore=True -p:AndroidSigningKeyStore="$(KeyStore)" -p:AndroidSigningStorePass=env:MyAndroidSigningStorePass -p:AndroidSigningKeyPass=env:MyAndroidSigningKeyPass -p:AndroidSigningKeyAlias="kp2a" DOTNET_PARAM += -p:AndroidKeyStore=True -p:AndroidSigningKeyStore="$(KeyStore)" -p:AndroidSigningStorePass=env:MyAndroidSigningStorePass -p:AndroidSigningKeyPass=env:MyAndroidSigningKeyPass -p:AndroidSigningKeyAlias="kp2a"
endif endif
ifeq ($(detected_OS),Windows) ifeq ($(detected_OS),Windows)
@@ -176,7 +154,7 @@ endif
# Recursive wildcard: https://stackoverflow.com/a/18258352 # Recursive wildcard: https://stackoverflow.com/a/18258352
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d)) rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
$(info MSBUILD_PARAM: $(MSBUILD_PARAM)) $(info DOTNET_PARAM: $(DOTNET_PARAM))
$(info nuget path: $(shell $(WHICH) nuget)) $(info nuget path: $(shell $(WHICH) nuget))
$(info ) $(info )
@@ -254,7 +232,7 @@ OUTPUT_PluginQR = src/java/Keepass2AndroidPluginSDK2/app/build/outputs/aar/Keepa
.PHONY: native $(NATIVE_COMPONENTS) clean_native $(NATIVE_CLEAN_TARGETS) \ .PHONY: native $(NATIVE_COMPONENTS) clean_native $(NATIVE_CLEAN_TARGETS) \
java $(JAVA_COMPONENTS) clean_java $(JAVA_CLEAN_TARGETS) \ java $(JAVA_COMPONENTS) clean_java $(JAVA_CLEAN_TARGETS) \
nuget clean_nuget \ nuget clean_nuget \
msbuild clean_msbuild \ dotnetbuild clean_dotnet \
apk all clean apk all clean
all: apk all: apk
@@ -303,7 +281,7 @@ ifeq ($(shell $(WHICH) nuget),)
endif endif
$(RMFILE) stamp.nuget_* $(RMFILE) stamp.nuget_*
nuget restore src/KeePass.sln nuget restore src/KeePass.sln
$(MSBUILD) src/KeePass.sln -t:restore $(MSBUILD_PARAM) -p:RestorePackagesConfig=true $(DOTNET) restore src/KeePass.sln $(DOTNET_PARAM) -p:RestorePackagesConfig=true
@echo "" > stamp.nuget_$(Flavor) @echo "" > stamp.nuget_$(Flavor)
manifestlink: manifestlink:
@@ -313,20 +291,20 @@ manifestlink:
##### #####
msbuild: manifestlink native java nuget dotnetbuild: manifestlink native java nuget
$(MSBUILD) src/KeePass.sln -target:keepass2android-app -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -p:BuildProjectReferences=true $(MSBUILD_PARAM) -p:Platform="Any CPU" -m $(DOTNET) build src/KeePass.sln -target:keepass2android-app -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -p:BuildProjectReferences=true $(DOTNET_PARAM) -p:Platform="Any CPU" -m
apk: msbuild apk: manifestlink native java nuget
$(MSBUILD) src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(MSBUILD_PARAM) -p:Platform=AnyCPU -m $(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m
apk_split: msbuild apk_split: manifestlink native java nuget
$(MSBUILD) src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(MSBUILD_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-arm $(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-arm
$(MSBUILD) src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(MSBUILD_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-arm64 $(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-arm64
$(MSBUILD) src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(MSBUILD_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-x86 $(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-x86
$(MSBUILD) src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(MSBUILD_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-x64 $(DOTNET) publish src/keepass2android-app/keepass2android-app.csproj -p:AndroidSdkDirectory="$(ANDROID_SDK_ROOT)" -t:SignAndroidPackage $(DOTNET_PARAM) -p:Platform=AnyCPU -m -p:RuntimeIdentifier=android-x64
src/build-scripts/rename-output-apks.sh src/keepass2android-app/bin/Release/net8.0-android/ src/build-scripts/rename-output-apks.sh src/keepass2android-app/bin/Release/net8.0-android/
build_all: msbuild build_all: dotnetbuild
##### Cleanup targets ##### Cleanup targets
@@ -370,10 +348,10 @@ else
endif endif
$(RMFILE) stamp.nuget_* $(RMFILE) stamp.nuget_*
clean_msbuild: clean_dotnet:
$(MSBUILD) src/KeePass.sln -target:clean $(MSBUILD_PARAM) $(DOTNET) clean src/KeePass.sln $(DOTNET_PARAM)
clean: clean_native clean_java clean_nuget clean_msbuild clean: clean_native clean_java clean_nuget clean_dotnet
distclean: clean distclean: clean
ifneq ("$(wildcard ./allow_git_clean)","") ifneq ("$(wildcard ./allow_git_clean)","")

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="216" android:versionCode="217"
android:versionName="1.12-r9b" android:versionName="1.12-r9c"
package="keepass2android.keepass2android" package="keepass2android.keepass2android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"> android:installLocation="auto">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="216" android:versionCode="217"
android:versionName="1.12-r9b" android:versionName="1.12-r9c"
package="keepass2android.keepass2android_nonet" package="keepass2android.keepass2android_nonet"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"> android:installLocation="auto">