From 7c8d9e2f14ac434661745367b785f22f604336bf Mon Sep 17 00:00:00 2001 From: Thilo Molitor Date: Wed, 31 Jul 2024 21:49:11 +0200 Subject: [PATCH] Try to fix workflows --- .github/workflows/beta.build-push.yml | 209 ++++++++++++----------- .github/workflows/quicksy.build-push.yml | 9 +- .github/workflows/stable.build-push.yml | 6 +- scripts/build.sh | 100 +++++------ 4 files changed, 163 insertions(+), 161 deletions(-) diff --git a/.github/workflows/beta.build-push.yml b/.github/workflows/beta.build-push.yml index 0a46966e2f..ee35a65ed8 100644 --- a/.github/workflows/beta.build-push.yml +++ b/.github/workflows/beta.build-push.yml @@ -41,7 +41,7 @@ jobs: run: git submodule update -f --init --remote - name: Get last build tag and increment it run: | - oldBuildNumber=$(git tag --sort="v:refname" |grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') + oldBuildNumber=$(git tag --sort="v:refname" | grep "Build_iOS" | grep -v "Quicksy_Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') buildNumber=$(expr $oldBuildNumber + 1) echo "New buildNumber is $buildNumber" git tag Build_iOS_$buildNumber @@ -64,7 +64,7 @@ jobs: printf("\n") }' } - buildNumber="$(git tag --sort="v:refname" | grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g')" + buildNumber="$(git tag --sort="v:refname" | grep "Build_iOS" | grep -v "Quicksy_Build_iOS" | tail -n1 | sed 's/Build_iOS_//g')" version="$(git log -n 1 --merges --pretty=format:%s | sed -E 's/^[\t\n ]*([^\n\t ]+)[\t\n ]+\(([^\n\t ]+)\)[\t\n ]*$/\1/g')" mkdir -p /Users/ci/releases OUTPUT_FILE="/Users/ci/releases/$buildNumber.output" @@ -105,26 +105,26 @@ jobs: run: chmod +x ./scripts/build.sh - name: Run build run: ./scripts/build.sh - - uses: actions/upload-artifact@v4 - with: - name: monal-ios - path: Monal/build/ipa/Monal.ipa - if-no-files-found: error - - uses: actions/upload-artifact@v4 - with: - name: monal-catalyst-dsym - path: Monal/build/macos_Monal.xcarchive/dSYMs - if-no-files-found: error - - uses: actions/upload-artifact@v4 - with: - name: monal-ios-dsym - path: Monal/build/ios_Monal.xcarchive/dSYMs - if-no-files-found: error + # - uses: actions/upload-artifact@v4 + # with: + # name: monal-ios + # path: Monal/build/ipa/Monal.ipa + # if-no-files-found: error + # - uses: actions/upload-artifact@v4 + # with: + # name: monal-catalyst-dsym + # path: Monal/build/macos_Monal.xcarchive/dSYMs + # if-no-files-found: error + # - uses: actions/upload-artifact@v4 + # with: + # name: monal-ios-dsym + # path: Monal/build/ios_Monal.xcarchive/dSYMs + # if-no-files-found: error - name: validate ios app run: xcrun altool --validate-app --file ./Monal/build/ipa/Monal.ipa --type ios --asc-provider S8D843U34Y -u "$(cat /Users/ci/apple_connect_upload_mail.txt)" -p "$(cat /Users/ci/apple_connect_upload_secret.txt)" - name: Push beta tag to repo run: | - buildNumber=$(git tag --sort="v:refname" | grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') + buildNumber=$(git tag --sort="v:refname" | grep "Build_iOS" | grep -v "Quicksy_Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') git push origin Build_iOS_$buildNumber - name: Create fastlane whatsNew hash in environment id: buildinfo @@ -133,14 +133,14 @@ jobs: CHANGELOG_MACOS: ${{ steps.releasenotes.outputs.notes_macos }} run: | get_changelog() { - local escaped=$(printf '%s\n' "$1" | jq -sRr @json) - local json="{\"default\":{\"whats_new\":$escaped}," - for dir in ./appstore_metadata/*/; do - dir="$(basename "$dir")" - if [[ -d "./appstore_metadata/$dir" && "$dir" == *-* ]]; then - json="$json\"${dir%/}\":{\"whats_new\":$escaped}," - fi - done + local escaped=$(printf 'LOCALIZED: %s\n' "$1" | jq -sRr @json) + local json="{\"default\": {whats_new: $escaped}," + # for dir in ./appstore_metadata/*/; do + # dir="$(basename "$dir")" + # if [[ -d "./appstore_metadata/$dir" && "$dir" == *-* ]]; then + # json="$json\"${dir%/}\": {whats_new: $escaped}," + # fi + # done json="${json%,}}" echo "$json" } @@ -156,89 +156,90 @@ jobs: env: PILOT_LOCALIZED_BUILD_INFO: ${{ steps.buildinfo.outputs.buildinfo_ios }} PILOT_CHANGELOG: ${{ steps.releasenotes.outputs.notes_ios }} + #fastlane run upload_to_testflight api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" ipa:"./Monal/build/ipa/Monal.ipa" distribute_external:true groups:"Internal Pre-Beta Testers","Public Beta" reject_build_waiting_for_review:true submit_beta_review:true run: | - fastlane run upload_to_testflight api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" ipa:"./Monal/build/ipa/Monal.ipa" distribute_external:true groups:"Internal Pre-Beta Testers","Public Beta" reject_build_waiting_for_review:true submit_beta_review:true - - name: Notarize catalyst - run: xcrun notarytool submit ./Monal/build/app/Monal.zip --wait --team-id S8D843U34Y --key "/Users/ci/appstoreconnect/apiKey.p8" --key-id "$(cat /Users/ci/appstoreconnect/apiKeyId.txt)" --issuer "$(cat /Users/ci/appstoreconnect/apiIssuerId.txt)" - - name: staple - run: | - cd Monal/build/app/tar_release/ - xcrun stapler staple "$APP_DIR" - stapler validate "$APP_DIR" - /usr/bin/ditto -c -k --sequesterRsrc --keepParent "$APP_DIR" "../$APP_NAME.zip" - cd ../../../.. - - uses: actions/upload-artifact@v4 - with: - name: monal-catalyst-zip - path: Monal/build/app/Monal.zip - if-no-files-found: error - - uses: actions/upload-artifact@v4 - with: - name: monal-catalyst-pkg - path: Monal/build/app/Monal.pkg - if-no-files-found: error - - name: Upload new catalyst beta to monal-im.org - run: ./scripts/uploadNonAlpha.sh beta + fastlane run upload_to_testflight api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" ipa:"./Monal/build/ipa/Monal.ipa" distribute_external:true notify_external_testers:true groups:"Internal Pre-Beta Testers" reject_build_waiting_for_review:true submit_beta_review:true --verbose + # - name: Notarize catalyst + # run: xcrun notarytool submit ./Monal/build/app/Monal.zip --wait --team-id S8D843U34Y --key "/Users/ci/appstoreconnect/apiKey.p8" --key-id "$(cat /Users/ci/appstoreconnect/apiKeyId.txt)" --issuer "$(cat /Users/ci/appstoreconnect/apiIssuerId.txt)" + # - name: staple + # run: | + # cd Monal/build/app/tar_release/ + # xcrun stapler staple "$APP_DIR" + # stapler validate "$APP_DIR" + # /usr/bin/ditto -c -k --sequesterRsrc --keepParent "$APP_DIR" "../$APP_NAME.zip" + # cd ../../../.. + # - uses: actions/upload-artifact@v4 + # with: + # name: monal-catalyst-zip + # path: Monal/build/app/Monal.zip + # if-no-files-found: error + # - uses: actions/upload-artifact@v4 + # with: + # name: monal-catalyst-pkg + # path: Monal/build/app/Monal.pkg + # if-no-files-found: error + # - name: Upload new catalyst beta to monal-im.org + # run: ./scripts/uploadNonAlpha.sh beta - name: Publish catalyst to appstore connect #run: xcrun altool --upload-app --file ./Monal/build/app/Monal.pkg --type macos --asc-provider S8D843U34Y -u "$(cat /Users/ci/apple_connect_upload_mail.txt)" -p "$(cat /Users/ci/apple_connect_upload_secret.txt)" --primary-bundle-id org.monal-im.prod.catalyst.monal env: PILOT_LOCALIZED_BUILD_INFO: ${{ steps.buildinfo.outputs.buildinfo_macos }} PILOT_CHANGELOG: ${{ steps.releasenotes.outputs.notes_macos }} run: | - fastlane run upload_to_testflight api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" pkg:"./Monal/build/app/Monal.pkg" distribute_external:true groups:"Internal Pre-Beta Testers","Public Beta" reject_build_waiting_for_review:true submit_beta_review:true - - name: Release - uses: softprops/action-gh-release@v2 - with: - name: "${{ steps.releasenotes.outputs.name }}" - tag_name: "${{ steps.releasenotes.outputs.tag }}" - target_commitish: beta - generate_release_notes: false - body: "${{ steps.releasenotes.outputs.notes }}" - files: | - ./Monal/build/ipa/Monal.ipa - ./Monal/build/app/Monal.pkg - ./Monal/build/app/Monal.zip - fail_on_unmatched_files: true - token: ${{ secrets.GITHUB_TOKEN }} - draft: false - prerelease: true + fastlane run upload_to_testflight api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" pkg:"./Monal/build/app/Monal.pkg" distribute_external:true notify_external_testers:true groups:"Internal Pre-Beta Testers" reject_build_waiting_for_review:true submit_beta_review:true --verbose + # - name: Release + # uses: softprops/action-gh-release@v2 + # with: + # name: "${{ steps.releasenotes.outputs.name }}" + # tag_name: "${{ steps.releasenotes.outputs.tag }}" + # target_commitish: beta + # generate_release_notes: false + # body: "${{ steps.releasenotes.outputs.notes }}" + # files: | + # ./Monal/build/ipa/Monal.ipa + # ./Monal/build/app/Monal.pkg + # ./Monal/build/app/Monal.zip + # fail_on_unmatched_files: true + # token: ${{ secrets.GITHUB_TOKEN }} + # draft: false + # prerelease: true - updateTranslations: - name: Update Translations using Beta-Branch - runs-on: self-hosted - needs: [buildAndPublishBeta] - env: - APP_NAME: "Monal" - APP_DIR: "Monal.app" - BUILD_TYPE: "Beta" - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - with: - clean: true - submodules: true - - name: Checkout submodules - run: git submodule update -f --init --remote - - name: Update translations - run: | - chmod +x ./scripts/updateLocalization.sh - chmod +x ./scripts/xliff_extractor.py - ./scripts/updateLocalization.sh BUILDSERVER - - notifyMuc: - name: Notify support MUC about new Betarelease - runs-on: ubuntu-latest - needs: [buildAndPublishBeta] - steps: - - name: Notify - uses: monal-im/xmpp-notifier@master - with: # Set the secrets as inputs - jid: ${{ secrets.BOT_JID }} - password: ${{ secrets.BOT_PASSWORD }} - server_host: ${{ secrets.BOT_SERVER }} - recipient: monal@chat.yax.im - recipient_is_room: true - bot_alias: "Monal Release Bot" - message: | - ${{ needs.buildAndPublishBeta.outputs.release-name }} was released - ${{ needs.buildAndPublishBeta.outputs.release-notes }} +# updateTranslations: +# name: Update Translations using Beta-Branch +# runs-on: self-hosted +# needs: [buildAndPublishBeta] +# env: +# APP_NAME: "Monal" +# APP_DIR: "Monal.app" +# BUILD_TYPE: "Beta" +# # Steps represent a sequence of tasks that will be executed as part of the job +# steps: +# - uses: actions/checkout@v4 +# with: +# clean: true +# submodules: true +# - name: Checkout submodules +# run: git submodule update -f --init --remote +# - name: Update translations +# run: | +# chmod +x ./scripts/updateLocalization.sh +# chmod +x ./scripts/xliff_extractor.py +# ./scripts/updateLocalization.sh BUILDSERVER +# +# notifyMuc: +# name: Notify support MUC about new Betarelease +# runs-on: ubuntu-latest +# needs: [buildAndPublishBeta] +# steps: +# - name: Notify +# uses: monal-im/xmpp-notifier@master +# with: # Set the secrets as inputs +# jid: ${{ secrets.BOT_JID }} +# password: ${{ secrets.BOT_PASSWORD }} +# server_host: ${{ secrets.BOT_SERVER }} +# recipient: monal@chat.yax.im +# recipient_is_room: true +# bot_alias: "Monal Release Bot" +# message: | +# ${{ needs.buildAndPublishBeta.outputs.release-name }} was released +# ${{ needs.buildAndPublishBeta.outputs.release-notes }} diff --git a/.github/workflows/quicksy.build-push.yml b/.github/workflows/quicksy.build-push.yml index e86eac9b0a..d75aa8a777 100644 --- a/.github/workflows/quicksy.build-push.yml +++ b/.github/workflows/quicksy.build-push.yml @@ -35,7 +35,7 @@ jobs: run: git submodule update -f --init --remote - name: Get last build tag and increment it run: | - oldBuildNumber=$(git tag --sort="v:refname" |grep "Quicksy_Build_iOS" | tail -n1 | sed 's/Quicksy_Build_iOS_//g') + oldBuildNumber=$(git tag --sort="v:refname" | grep "Quicksy_Build_iOS" | tail -n1 | sed 's/Quicksy_Build_iOS_//g') buildNumber=$(expr $oldBuildNumber + 1) echo "New buildNumber is $buildNumber" git tag Quicksy_Build_iOS_$buildNumber @@ -58,15 +58,16 @@ jobs: printf("\n") }' } - buildNumber="$(git tag --sort="v:refname" | grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g')" + buildNumber="$(git tag --sort="v:refname" | grep "Quicksy_Build_iOS" | tail -n1 | sed 's/Quicksy_Build_iOS_//g')" version="$(git log -n 1 --merges --pretty=format:%s | sed -E 's/^[\t\n ]*([^\n\t ]+)[\t\n ]+\(([^\n\t ]+)\)[\t\n ]*$/\1/g')" + version="6.4.2" mkdir -p /Users/ci/releases OUTPUT_FILE="/Users/ci/releases/$buildNumber.output" touch "$OUTPUT_FILE" echo "OUTPUT_FILE=$OUTPUT_FILE" | tee /dev/stderr >> "$GITHUB_OUTPUT" echo "buildNumber=$buildNumber" | tee /dev/stderr >> "$OUTPUT_FILE" - echo "tag=Build_iOS_$buildNumber" | tee /dev/stderr >> "$OUTPUT_FILE" + echo "tag=Quicksy_Build_iOS_$buildNumber" | tee /dev/stderr >> "$OUTPUT_FILE" echo "version=$version" | tee /dev/stderr >> "$OUTPUT_FILE" echo "buildVersion=$(echo "$version" | grep -oE '^[0-9]+(\.[0-9]+){0,2}')" | tee /dev/stderr >> "$OUTPUT_FILE" @@ -114,7 +115,7 @@ jobs: - name: push tag to stable repo run: | buildNumber=$(git tag --sort="v:refname" | grep "Quicksy_Build_iOS" | tail -n1 | sed 's/Quicksy_Build_iOS_//g') - git push origin Build_iOS_$buildNumber + git push origin Quicksy_Build_iOS_$buildNumber - name: Create fastlane metadata directory id: metadata env: diff --git a/.github/workflows/stable.build-push.yml b/.github/workflows/stable.build-push.yml index 4dfef89db5..0c82d9f668 100644 --- a/.github/workflows/stable.build-push.yml +++ b/.github/workflows/stable.build-push.yml @@ -37,7 +37,7 @@ jobs: run: git submodule update -f --init --remote - name: Get last build tag and increment it run: | - oldBuildNumber=$(git tag --sort="v:refname" |grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') + oldBuildNumber=$(git tag --sort="v:refname" | grep "Build_iOS" | grep -v "Quicksy_Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') buildNumber=$(expr $oldBuildNumber + 1) echo "New buildNumber is $buildNumber" git tag Build_iOS_$buildNumber @@ -60,7 +60,7 @@ jobs: printf("\n") }' } - buildNumber="$(git tag --sort="v:refname" | grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g')" + buildNumber="$(git tag --sort="v:refname" | grep "Build_iOS" | grep -v "Quicksy_Build_iOS" | tail -n1 | sed 's/Build_iOS_//g')" version="$(git log -n 1 --merges --pretty=format:%s | sed -E 's/^[\t\n ]*([^\n\t ]+)[\t\n ]+\(([^\n\t ]+)\)[\t\n ]*$/\1/g')" mkdir -p /Users/ci/releases OUTPUT_FILE="/Users/ci/releases/$buildNumber.output" @@ -120,7 +120,7 @@ jobs: run: xcrun altool --validate-app --file ./Monal/build/ipa/Monal.ipa --type ios -u $(cat /Users/ci/apple_connect_upload_mail.txt) -p "$(cat /Users/ci/apple_connect_upload_secret.txt)" - name: push tag to stable repo run: | - buildNumber=$(git tag --sort="v:refname" |grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') + buildNumber=$(git tag --sort="v:refname" |grep "Build_iOS" | grep -v "Quicksy_Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') git push origin Build_iOS_$buildNumber - name: Create fastlane metadata directory id: metadata diff --git a/scripts/build.sh b/scripts/build.sh index d0b31bdf3e..d5d4b28b01 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -42,56 +42,56 @@ echo "* Installing macOS & iOS Pods *" echo "***************************************" pod install --repo-update -if [ "$BUILD_SCHEME" != "Quicksy" ]; then - echo "" - echo "***************************" - echo "* Archiving macOS *" - echo "***************************" - xcrun xcodebuild \ - -workspace "Monal.xcworkspace" \ - -scheme "$BUILD_SCHEME" \ - -sdk macosx \ - -configuration $BUILD_TYPE \ - -destination 'generic/platform=macOS,variant=Mac Catalyst,name=Any Mac' \ - -archivePath "build/macos_$APP_NAME.xcarchive" \ - -allowProvisioningUpdates \ - archive \ - BUILD_LIBRARIES_FOR_DISTRIBUTION=YES \ - SUPPORTS_MACCATALYST=YES - - echo "" - echo "****************************" - echo "* Exporting macOS *" - echo "****************************" - # see: https://gist.github.com/cocoaNib/502900f24846eb17bb29 - # and: https://forums.developer.apple.com/thread/100065 - # and: for developer-id distribution (distribution *outside* of appstore) an developer-id certificate must be used for building - if [ ! -z ${EXPORT_OPTIONS_CATALYST_APPSTORE} ]; then - echo "***************************************" - echo "* Exporting AppStore macOS *" - echo "***************************************" - exportMacOS "$EXPORT_OPTIONS_CATALYST_APPSTORE" "$BUILD_TYPE" - fi - - if [ ! -z ${EXPORT_OPTIONS_CATALYST_APP_EXPORT} ]; then - echo "***********************************" - echo "* Exporting app macOS *" - echo "***********************************" - exportMacOS "$EXPORT_OPTIONS_CATALYST_APP_EXPORT" "$BUILD_TYPE" - - echo "" - echo "**************************" - echo "* Packing macOS zip *" - echo "**************************" - cd build/app - mkdir tar_release - mv "$APP_NAME.app" "tar_release/$APP_DIR" - cd tar_release - /usr/bin/ditto -c -k --sequesterRsrc --keepParent "$APP_DIR" "../$APP_NAME".zip - cd ../../.. - ls -l build/app - fi -fi +# if [ "$BUILD_SCHEME" != "Quicksy" ]; then +# echo "" +# echo "***************************" +# echo "* Archiving macOS *" +# echo "***************************" +# xcrun xcodebuild \ +# -workspace "Monal.xcworkspace" \ +# -scheme "$BUILD_SCHEME" \ +# -sdk macosx \ +# -configuration $BUILD_TYPE \ +# -destination 'generic/platform=macOS,variant=Mac Catalyst,name=Any Mac' \ +# -archivePath "build/macos_$APP_NAME.xcarchive" \ +# -allowProvisioningUpdates \ +# archive \ +# BUILD_LIBRARIES_FOR_DISTRIBUTION=YES \ +# SUPPORTS_MACCATALYST=YES +# +# echo "" +# echo "****************************" +# echo "* Exporting macOS *" +# echo "****************************" +# # see: https://gist.github.com/cocoaNib/502900f24846eb17bb29 +# # and: https://forums.developer.apple.com/thread/100065 +# # and: for developer-id distribution (distribution *outside* of appstore) an developer-id certificate must be used for building +# if [ ! -z ${EXPORT_OPTIONS_CATALYST_APPSTORE} ]; then +# echo "***************************************" +# echo "* Exporting AppStore macOS *" +# echo "***************************************" +# exportMacOS "$EXPORT_OPTIONS_CATALYST_APPSTORE" "$BUILD_TYPE" +# fi +# +# if [ ! -z ${EXPORT_OPTIONS_CATALYST_APP_EXPORT} ]; then +# echo "***********************************" +# echo "* Exporting app macOS *" +# echo "***********************************" +# exportMacOS "$EXPORT_OPTIONS_CATALYST_APP_EXPORT" "$BUILD_TYPE" +# +# echo "" +# echo "**************************" +# echo "* Packing macOS zip *" +# echo "**************************" +# cd build/app +# mkdir tar_release +# mv "$APP_NAME.app" "tar_release/$APP_DIR" +# cd tar_release +# /usr/bin/ditto -c -k --sequesterRsrc --keepParent "$APP_DIR" "../$APP_NAME".zip +# cd ../../.. +# ls -l build/app +# fi +# fi echo "" echo "*************************"