diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0f3c5cc22f..9f053852e7 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -4,19 +4,16 @@ on: push: branches: - master - - release-** + - nlsfi-release pull_request: - release: - types: ['published'] workflow_dispatch: + release: + types: ['created', 'edited'] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - jobs: build: runs-on: ubuntu-24.04 @@ -32,30 +29,30 @@ jobs: qt_arch: 'android_arm64_v8a' all_files_access: 'ON' artifact_name: 'android-arm64' - - triplet: 'arm-neon-android' - qt_arch: 'android_armv7' - all_files_access: 'OFF' - artifact_name: 'android-arm-neon' - - triplet: 'arm-neon-android' - qt_arch: 'android_armv7' - all_files_access: 'ON' - artifact_name: 'android-arm-neon' - - triplet: 'x64-android' - qt_arch: 'android_x86_64' - all_files_access: 'OFF' - artifact_name: 'android-x64' - - triplet: 'x64-android' - qt_arch: 'android_x86_64' - all_files_access: 'ON' - artifact_name: 'android-x64' - - triplet: 'x86-android' - qt_arch: 'android_x86' - all_files_access: 'OFF' - artifact_name: 'android-x86' - - triplet: 'x86-android' - qt_arch: 'android_x86' - all_files_access: 'ON' - artifact_name: 'android-x86' + # - triplet: 'arm-neon-android' + # qt_arch: 'android_armv7' + # all_files_access: 'OFF' + # artifact_name: 'android-arm-neon' + # - triplet: 'arm-neon-android' + # qt_arch: 'android_armv7' + # all_files_access: 'ON' + # artifact_name: 'android-arm-neon' + # - triplet: 'x64-android' + # qt_arch: 'android_x86_64' + # all_files_access: 'OFF' + # artifact_name: 'android-x64' + # - triplet: 'x64-android' + # qt_arch: 'android_x86_64' + # all_files_access: 'ON' + # artifact_name: 'android-x64' + # - triplet: 'x86-android' + # qt_arch: 'android_x86' + # all_files_access: 'OFF' + # artifact_name: 'android-x86' + # - triplet: 'x86-android' + # qt_arch: 'android_x86' + # all_files_access: 'ON' + # artifact_name: 'android-x86' steps: - name: 🐣 Checkout @@ -143,6 +140,8 @@ jobs: - name: 🌱 Install dependencies and generate project files env: WORKSPACE: ${{ github.workspace }} + QFC_URL_PROD: ${{ secrets.QFC_URL_PROD }} + QFC_URL_DEV: ${{ secrets.QFC_URL_DEV }} run: | TRIPLET=${{ matrix.triplet }} ALL_FILES_ACCESS=${{ matrix.all_files_access }} source ./scripts/version_number.sh TRIPLET=${{ matrix.triplet }} ALL_FILES_ACCESS=${{ matrix.all_files_access }} source ./scripts/ci/generate-version-details.sh @@ -164,6 +163,7 @@ jobs: -D APP_PACKAGE_NAME="${APP_PACKAGE_NAME}" \ -D APP_ICON="${APP_ICON}" \ -D APP_NAME="${APP_NAME}" \ + -D QFC_URL="${QFC_URL}" \ -D NUGET_USERNAME=opengisch \ -D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} \ -D SENTRY_DSN=${{ secrets.SENTRY_DSN }} \ @@ -185,7 +185,7 @@ jobs: - name: 🔑 Setup signing key env: - SIGNINGKEY: ${{ secrets.PLAYSTORE_SIGNINGKEY }} + SIGNINGKEY: ${{ secrets.APK_SIGNINGKEY }} run: | echo "$SIGNINGKEY" | base64 --decode > ./keystore.p12 @@ -205,13 +205,20 @@ jobs: ${{ env.CMAKE_BUILD_DIR }}/src/app/android-build/build/outputs/apk/release/android-build-release-signed.apk ${{ env.CMAKE_BUILD_DIR }}/src/app/android-build/build/outputs/apk/debug/android-build-debug.apk - - name: 🍺 Deploy + # - name: 🍺 Deploy + # run: | + # sudo apt install -y s3cmd + # # This script will rename the artifact and move it to /tmp + # NAME=${{ matrix.artifact_name }} ALL_FILES_ACCESS=${{ matrix.all_files_access }} ./scripts/ci/upload_artifacts.sh + # env: + # S3CFG: ${{ secrets.S3CMD_CFG }} + + - name: mv apk files run: | - sudo apt install -y s3cmd - # This script will rename the artifact and move it to /tmp - NAME=${{ matrix.artifact_name }} ALL_FILES_ACCESS=${{ matrix.all_files_access }} ./scripts/ci/upload_artifacts.sh - env: - S3CFG: ${{ secrets.S3CMD_CFG }} + set -e + FILENAME_APK="${CI_PACKAGE_NAME}-${CI_PACKAGE_FILE_SUFFIX}-${{ matrix.artifact_name }}.apk" + echo "📦 Renaming APK to /tmp/${FILENAME_APK}" + mv "${CMAKE_BUILD_DIR}/src/app/android-build/build/outputs/apk/release/android-build-release-signed.apk" "/tmp/${FILENAME_APK}" - name: Upload release assets uses: AButler/upload-release-assets@v3.0 @@ -231,49 +238,49 @@ jobs: bundle exec fastlane run sentry_debug_files_upload path:${{ env.CMAKE_BUILD_DIR }}/src/app/android-build/build/intermediates/merged_native_libs/release - deploy_to_playstore: - name: deploy to play store - runs-on: ubuntu-22.04 - needs: build - if: ${{ ( github.event_name == 'release' || ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) ) }} - steps: - - name: Checkout - uses: actions/checkout@v6 - if: ${{ env.SENTRY_AUTH_TOKEN != '' }} - - - name: Vars - id: vars - if: ${{ env.SENTRY_AUTH_TOKEN != '' }} - run: | - ./scripts/ci/env_gh.sh - - - name: Download apks - if: ${{ env.SENTRY_AUTH_TOKEN != '' }} - run: | - wget https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-arm64.apk - wget https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-arm-neon.apk - wget https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-x64.apk - wget https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-x86.apk - - - name: Upload to Google Play Store - if: ${{ env.SENTRY_AUTH_TOKEN != '' }} - run: | - pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib oauth2client - - if [[ -n "${{ env.CI_TAG }}" ]] - then - RELEASE_MESSAGE="Find out what's new on https://github.com/opengisch/QField/releases/tag/${{ env.CI_TAG }}" - else - RELEASE_MESSAGE="Update from commit ${GITHUB_SHA}" - fi - - ./scripts/basic_upload_apks_service_account.py ch.opengis.${{ env.APP_PACKAGE_NAME }} beta "${RELEASE_MESSAGE}" \ - qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-arm64.apk \ - qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-arm-neon.apk \ - qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-x64.apk \ - qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-x86.apk - env: - GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} + # deploy_to_playstore: + # name: deploy to play store + # runs-on: ubuntu-22.04 + # needs: build + # if: ${{ ( github.event_name == 'release' || ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) ) }} + # steps: + # - name: Checkout + # uses: actions/checkout@v6 + # if: ${{ env.SENTRY_AUTH_TOKEN != '' }} + + # - name: Vars + # id: vars + # if: ${{ env.SENTRY_AUTH_TOKEN != '' }} + # run: | + # ./scripts/ci/env_gh.sh + + # - name: Download apks + # if: ${{ env.SENTRY_AUTH_TOKEN != '' }} + # run: | + # wget https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-arm64.apk + # wget https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-arm-neon.apk + # wget https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-x64.apk + # wget https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-x86.apk + + # - name: Upload to Google Play Store + # if: ${{ env.SENTRY_AUTH_TOKEN != '' }} + # run: | + # pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib oauth2client + + # if [[ -n "${{ env.CI_TAG }}" ]] + # then + # RELEASE_MESSAGE="Find out what's new on https://github.com/opengisch/QField/releases/tag/${{ env.CI_TAG }}" + # else + # RELEASE_MESSAGE="Update from commit ${GITHUB_SHA}" + # fi + + # ./scripts/basic_upload_apks_service_account.py ch.opengis.${{ env.APP_PACKAGE_NAME }} beta "${RELEASE_MESSAGE}" \ + # qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-arm64.apk \ + # qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-arm-neon.apk \ + # qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-x64.apk \ + # qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-android-x86.apk + # env: + # GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} comment_pr: diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index b2790301c0..64a791c63c 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -1,14 +1,7 @@ --- name: 🍏 iOS -on: - push: - branches: - - master - - release-** - pull_request: - release: - types: ['published'] +on: [] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 71f4035101..efcabce747 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -4,10 +4,11 @@ on: push: branches: - master - - release-** + - nlsfi-release pull_request: + workflow_dispatch: release: - types: ['published'] + types: ['created', 'edited'] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -186,14 +187,14 @@ jobs: asset_name: ${{ env.ARTIFACT_NAME }} overwrite: true - - name: 📮 Upload debug symbols - if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && env.ARTIFACT_NAME != null - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG_SLUG: opengisch - SENTRY_PROJECT_SLUG: qfield - run: | - bundle exec fastlane run sentry_debug_files_upload path:build + # - name: 📮 Upload debug symbols + # if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && env.ARTIFACT_NAME != null + # env: + # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + # SENTRY_ORG_SLUG: opengisch + # SENTRY_PROJECT_SLUG: qfield + # run: | + # bundle exec fastlane run sentry_debug_files_upload path:build - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index eec328b2ab..1d6fd8ddf7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,13 +1,6 @@ --- name: 🍎 MacOS -on: - push: - branches: - - master - - release-** - pull_request: - release: - types: ['published'] +on: [] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bdf8be7413..51834f21ff 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -7,7 +7,7 @@ on: - release-** pull_request: release: - types: ['published'] + types: ['created', 'edited'] workflow_dispatch: concurrency: @@ -146,21 +146,21 @@ jobs: ${{ env.CMAKE_BUILD_DIR }}/_CPack_Packages/**/*.log ${{ env.CMAKE_BUILD_DIR }}/CMakeCache.txt - - name: 🎭 Sign - if: ( github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') ) || github.event_name == 'workflow_dispatch' && env.ARTIFACT_NAME != null - uses: azure/trusted-signing-action@v0.5.11 - with: - azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} - azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} - azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} - endpoint: https://weu.codesigning.azure.net/ - code-signing-account-name: OPENGISch - certificate-profile-name: OPENGISch - files-folder: ${{ env.CMAKE_BUILD_DIR }} - files-folder-filter: exe,msi - file-digest: SHA256 - timestamp-rfc3161: http://timestamp.acs.microsoft.com - timestamp-digest: SHA256 + # - name: 🎭 Sign + # if: ( github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') ) || github.event_name == 'workflow_dispatch' && env.ARTIFACT_NAME != null + # uses: azure/trusted-signing-action@v0.5.11 + # with: + # azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} + # azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} + # endpoint: https://weu.codesigning.azure.net/ + # code-signing-account-name: OPENGISch + # certificate-profile-name: OPENGISch + # files-folder: ${{ env.CMAKE_BUILD_DIR }} + # files-folder-filter: exe,msi + # file-digest: SHA256 + # timestamp-rfc3161: http://timestamp.acs.microsoft.com + # timestamp-digest: SHA256 - name: 📦 Upload package if: ${{ env.ARTIFACT_NAME != null }} @@ -191,15 +191,15 @@ jobs: ruby-version: '3.4' # Not needed with a .ruby-version file bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: 🍺 Upload to S3 - if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') - env: - S3_BUCKET: qfieldapks - S3_REGION: ch-dk-2 - S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY}} - S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}} - run: | - bundle exec fastlane windows upload_s3 exe:${{ env.ARTIFACT_PATHNAME }} + # - name: 🍺 Upload to S3 + # if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') + # env: + # S3_BUCKET: qfieldapks + # S3_REGION: ch-dk-2 + # S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY}} + # S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}} + # run: | + # bundle exec fastlane windows upload_s3 exe:${{ env.ARTIFACT_PATHNAME }} - name: 📮 Upload debug symbols if: ${{ env.SENTRY_AUTH_TOKEN != '' }} @@ -213,7 +213,8 @@ jobs: name: deploy (ms store) runs-on: windows-2022 - if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') + if: false + # if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') needs: build diff --git a/CMakeLists.txt b/CMakeLists.txt index a921e57390..c0409d2692 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(APK_VERSION_CODE "1" CACHE STRING "Apk Version Code (Example: 1)") set(APP_VERSION "0" CACHE STRING "Application Version (Example: v1.0.0)") set(APP_VERSION_STR "local - dev" CACHE STRING "Application Version Name (Example: 1.0.0 - Homerun)") set(APP_PACKAGE_NAME "qfield" CACHE STRING "Package name suffix. E.g. qfield --> ch.opengis.qfield") +set(QFC_URL "https://app.qfield.cloud" CACHE STRING "Default QfieldCloud url") string(REGEX REPLACE "v" "" CLEAN_APP_VERSION "${APP_VERSION}") diff --git a/export_logo.sh b/export_logo.sh new file mode 100644 index 0000000000..b13b3c126f --- /dev/null +++ b/export_logo.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Converts one SVG into Android drawable PNGs for all DPI buckets. +# Requires: ImageMagick (convert command) + +set -e + +# === CONFIGURATION === +SRC_SVG="images/icons/qfield_logo.svg" # your source SVG file +BASE_SIZE=48 # mdpi size in px (change for logos) +OUT_DIR="platform/android/res" + +# === Density multipliers === +declare -A DENSITIES=( + [ldpi]=0.75 + [mdpi]=1.0 + [hdpi]=1.5 + [xhdpi]=2.0 + [xxhdpi]=3.0 + [xxxhdpi]=4.0 +) + +# === MAIN === +if [[ ! -f "$SRC_SVG" ]]; then + echo "Error: SVG source '$SRC_SVG' not found!" + exit 1 +fi + +for density in "${!DENSITIES[@]}"; do + scale=${DENSITIES[$density]} + size=$(awk -v base="$BASE_SIZE" -v s="$scale" 'BEGIN { printf "%d", base * s }') + outdir="$OUT_DIR/drawable-$density" + mkdir -p "$outdir" + outfile="$outdir/qfield_logo.png" + + echo "🖼️ Generating $outfile (${size}x${size})" + magick convert -background none -resize "${size}x${size}" "$SRC_SVG" "$outfile" +done + +echo "✅ All drawable sizes generated under $OUT_DIR" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 9a7067a731..59c51ea4cc 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -13,7 +13,7 @@ end platform :ios do lane :setup_signing do |options| signing_type = options[:type] # "development", "appstore" - app_identifier = options[:app_identifier] # "ch.opengis.qfield", "ch.opengis.qfield-dev" + app_identifier = options[:app_identifier] # "fi.nls.qfield", "fi.nls.qfield-dev" setup_ci if is_ci @@ -64,25 +64,25 @@ platform :ios do ) match_nuke( type: "development", - app_identifier: ['ch.opengis.qfield', 'ch.opengis.qfield-dev'], + app_identifier: ['fi.nls.qfield', 'fi.nls.qfield-dev'], skip_confirmation: true, readonly: false ) match_nuke( type: "appstore", - app_identifier: ['ch.opengis.qfield'], + app_identifier: ['fi.nls.qfield'], skip_confirmation: true, readonly: false ) sync_code_signing( type: "development", - app_identifier: ['ch.opengis.qfield', 'ch.opengis.qfield-dev'], + app_identifier: ['fi.nls.qfield', 'fi.nls.qfield-dev'], force_for_new_devices: true, readonly: false ) sync_code_signing( type: "appstore", - app_identifier: ['ch.opengis.qfield'], + app_identifier: ['fi.nls.qfield'], force_for_new_devices: true, readonly: false ) diff --git a/fastlane/Matchfile b/fastlane/Matchfile index 38f3adf927..ef926fef89 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -4,4 +4,4 @@ storage_mode("git") type("development") # The default type, can be: appstore, adhoc, enterprise or development -app_identifier(["ch.opengis.qfield", "ch.opengis.qfield-dev"]) +app_identifier(["fi.nls.qfield", "fi.nls.qfield-dev"]) diff --git a/images/icons/qfield_logo.svg b/images/icons/qfield_logo.svg index f1fddda553..f4a505906c 100644 --- a/images/icons/qfield_logo.svg +++ b/images/icons/qfield_logo.svg @@ -1,21 +1,23 @@ image/svg+xml + id="grid840" + originx="79.695865" + originy="-14.27453" + spacingy="1" + spacingx="1" + units="px" /> +