Open .slatepack file with the app #13

Merged
ardocrat merged 28 commits from slatepack_ext_file into master 2024-09-16 19:08:27 +03:00
2 changed files with 27 additions and 17 deletions
Showing only changes of commit 9ea0da95b7 - Show all commits

View file

@ -38,7 +38,7 @@ jobs:
- name: Checksum AppImage x86 - name: Checksum AppImage x86
working-directory: target/x86_64-unknown-linux-gnu/release working-directory: target/x86_64-unknown-linux-gnu/release
shell: pwsh shell: pwsh
run: get-filehash -algorithm sha256 grim-${{ github.ref_name }}-linux-x86_64.AppImage | Format-List | Out-String | ForEach-Object { $_.Trim() } > grim-${{ github.ref_name }}-linux-x86_64-appimage-sha256sum.txt run: sha256sum grim-${{ github.ref_name }}-linux-x86_64.AppImage > grim-${{ github.ref_name }}-linux-x86_64-appimage-sha256sum.txt
- name: AppImage ARM - name: AppImage ARM
run: | run: |
cp target/aarch64-unknown-linux-gnu/release/grim linux/Grim.AppDir/AppRun cp target/aarch64-unknown-linux-gnu/release/grim linux/Grim.AppDir/AppRun
@ -46,7 +46,7 @@ jobs:
- name: Checksum AppImage ARM - name: Checksum AppImage ARM
working-directory: target/aarch64-unknown-linux-gnu/release working-directory: target/aarch64-unknown-linux-gnu/release
shell: pwsh shell: pwsh
run: get-filehash -algorithm sha256 grim-${{ github.ref_name }}-linux-arm.AppImage | Format-List | Out-String | ForEach-Object { $_.Trim() } > grim-${{ github.ref_name }}-linux-arm-appimage-sha256sum.txt run: sha256sum grim-${{ github.ref_name }}-linux-arm.AppImage > grim-${{ github.ref_name }}-linux-arm-appimage-sha256sum.txt
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
@ -74,7 +74,7 @@ jobs:
- name: Checksum release - name: Checksum release
working-directory: target/release working-directory: target/release
shell: pwsh shell: pwsh
run: get-filehash -algorithm sha256 grim-${{ github.ref_name }}-win-x86_64.zip | Format-List | Out-String | ForEach-Object { $_.Trim() } > grim-${{ github.ref_name }}-win-x86_64-sha256sum.txt run: sha256sum grim-${{ github.ref_name }}-win-x86_64.zip > grim-${{ github.ref_name }}-win-x86_64-sha256sum.txt
- name: Install cargo-wix - name: Install cargo-wix
run: cargo install cargo-wix run: cargo install cargo-wix
- name: Run cargo-wix - name: Run cargo-wix
@ -82,7 +82,7 @@ jobs:
- name: Checksum msi - name: Checksum msi
working-directory: target/wix working-directory: target/wix
shell: pwsh shell: pwsh
run: get-filehash -algorithm sha256 grim-${{ github.ref_name }}-win-x86_64.msi | Format-List | Out-String | ForEach-Object { $_.Trim() } > grim-${{ github.ref_name }}-win-x86_64-msi-sha256sum.txt run: sha256sum grim-${{ github.ref_name }}-win-x86_64.msi > grim-${{ github.ref_name }}-win-x86_64-msi-sha256sum.txt
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
@ -121,7 +121,7 @@ jobs:
- name: Checksum Release x86 - name: Checksum Release x86
working-directory: target/x86_64-apple-darwin/release working-directory: target/x86_64-apple-darwin/release
shell: pwsh shell: pwsh
run: get-filehash -algorithm sha256 grim-${{ github.ref_name }}-macos-x86_64.zip | Format-List | Out-String | ForEach-Object { $_.Trim() } > grim-${{ github.ref_name }}-macos-x86_64-sha256sum.txt run: sha256sum grim-${{ github.ref_name }}-macos-x86_64.zip > grim-${{ github.ref_name }}-macos-x86_64-sha256sum.txt
- name: Release ARM - name: Release ARM
run: | run: |
rustup target add aarch64-apple-darwin rustup target add aarch64-apple-darwin
@ -136,7 +136,7 @@ jobs:
- name: Checksum Release ARM - name: Checksum Release ARM
working-directory: target/aarch64-apple-darwin/release working-directory: target/aarch64-apple-darwin/release
shell: pwsh shell: pwsh
run: get-filehash -algorithm sha256 grim-${{ github.ref_name }}-macos-arm.zip | Format-List | Out-String | ForEach-Object { $_.Trim() } > grim-${{ github.ref_name }}-macos-arm-sha256sum.txt run: sha256sum grim-${{ github.ref_name }}-macos-arm.zip > grim-${{ github.ref_name }}-macos-arm-sha256sum.txt
- name: Release Universal - name: Release Universal
run: | run: |
rustup target add aarch64-apple-darwin rustup target add aarch64-apple-darwin
@ -152,7 +152,7 @@ jobs:
- name: Checksum Release Universal - name: Checksum Release Universal
working-directory: target/universal2-apple-darwin/release working-directory: target/universal2-apple-darwin/release
shell: pwsh shell: pwsh
run: get-filehash -algorithm sha256 grim-${{ github.ref_name }}-macos-universal.zip | Format-List | Out-String | ForEach-Object { $_.Trim() } > grim-${{ github.ref_name }}-macos-universal-sha256sum.txt run: sha256sum grim-${{ github.ref_name }}-macos-universal.zip > grim-${{ github.ref_name }}-macos-universal-sha256sum.txt
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:

View file

@ -33,6 +33,7 @@ cargo install cargo-ndk
success=0 success=0
### Build native code ### Build native code
[[ $1 == "release" ]] && release_param="--profile release-apk"
function build_lib() { function build_lib() {
[[ $1 == "v7" ]] && arch=(armeabi-v7a) [[ $1 == "v7" ]] && arch=(armeabi-v7a)
[[ $1 == "v8" ]] && arch=(arm64-v8a) [[ $1 == "v8" ]] && arch=(arm64-v8a)
@ -42,9 +43,9 @@ function build_lib() {
# Fix for https://stackoverflow.com/questions/57193895/error-use-of-undeclared-identifier-pthread-mutex-robust-cargo-build-liblmdb-s # Fix for https://stackoverflow.com/questions/57193895/error-use-of-undeclared-identifier-pthread-mutex-robust-cargo-build-liblmdb-s
export CPPFLAGS="-DMDB_USE_ROBUST=0" && export CFLAGS="-DMDB_USE_ROBUST=0" export CPPFLAGS="-DMDB_USE_ROBUST=0" && export CFLAGS="-DMDB_USE_ROBUST=0"
cargo ndk -t ${arch} build --profile release-apk cargo ndk -t ${arch} build ${release_param}
unset CPPFLAGS && unset CFLAGS unset CPPFLAGS && unset CFLAGS
cargo ndk -t ${arch} -o android/app/src/main/jniLibs build --profile release-apk cargo ndk -t ${arch} -o android/app/src/main/jniLibs build ${release_param}
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
success=1 success=1
@ -61,20 +62,24 @@ function build_apk() {
./gradlew clean ./gradlew clean
./gradlew assembleSignedRelease ./gradlew assembleSignedRelease
# Setup release file name
if [ -n $1 ]; then if [ -n $1 ]; then
rm -rf grim-${version}-$1.apk # Setup release file name
mv app/build/outputs/apk/signedRelease/app-signedRelease.apk grim-${version}-$1.apk name=grim-${version}-android-$1.apk
if [[ $1 == "arm" ]]; then
name=grim-${version}-android.apk
fi
rm -rf ${name}
mv app/build/outputs/apk/signedRelease/app-signedRelease.apk ${name}
# Calculate checksum
checksum=grim-${version}-$1-sha256sum.txt
rm -rf ${checksum}
sha256sum ${name} > ${checksum}
fi fi
cd .. cd ..
} }
# Remove build targets
rm -rf target/release-apk
rm -rf target/aarch64-linux-android
rm -rf target/x86_64-linux-android
rm -rf target/armv7-linux-androideabi
rm -rf android/app/src/main/jniLibs/* rm -rf android/app/src/main/jniLibs/*
if [[ $1 == "build" ]]; then if [[ $1 == "build" ]]; then
@ -89,6 +94,11 @@ if [[ $1 == "build" ]]; then
adb -s $SERIAL shell am start -n mw.gri.android/.MainActivity; adb -s $SERIAL shell am start -n mw.gri.android/.MainActivity;
done done
else else
rm -rf target/release-apk
rm -rf target/aarch64-linux-android
rm -rf target/x86_64-linux-android
rm -rf target/armv7-linux-androideabi
build_lib "v7" build_lib "v7"
[ $success -eq 1 ] && build_lib "v8" [ $success -eq 1 ] && build_lib "v8"
[ $success -eq 1 ] && build_apk "arm" [ $success -eq 1 ] && build_apk "arm"