6.4.1b2 (#1097) #181
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build a new beta release and push it to apple | |
name: beta.build-push | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push | |
push: | |
branches: [ beta ] | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
buildAndPublishBeta: | |
name: "Build and Publish Beta Release" | |
runs-on: self-hosted | |
outputs: | |
release-tag: ${{ steps.releasenotes.outputs.tag }} | |
release-name: ${{ steps.releasenotes.outputs.name }} | |
release-changelog: ${{ steps.releasenotes.outputs.notes }} | |
env: | |
APP_NAME: "Monal" | |
APP_DIR: "Monal.app" | |
BUILD_TYPE: "Beta" | |
EXPORT_OPTIONS_CATALYST_APPSTORE: "../scripts/exportOptions/Stable_Catalyst_ExportOptions.plist" | |
EXPORT_OPTIONS_CATALYST_APP_EXPORT: "../scripts/exportOptions/Beta_Catalyst_ExportOptions.plist" | |
EXPORT_OPTIONS_IOS: "../scripts/exportOptions/Beta_iOS_ExportOptions.plist" | |
# 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 | |
fetch-depth: 100 | |
fetch-tags: true | |
show-progress: true | |
lfs: true | |
- name: Checkout submodules | |
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') | |
buildNumber=$(expr $oldBuildNumber + 1) | |
echo "New buildNumber is $buildNumber" | |
git tag Build_iOS_$buildNumber | |
- name: Insert buildNumber into plists | |
run: sh ./scripts/set_version_number.sh | |
- name: Import TURN secrets | |
run: | | |
if [[ -e "/Users/ci/secrets.monal_beta" ]]; then | |
echo "#import \"/Users/ci/secrets.monal_beta\"" > Monal/Classes/secrets.h | |
fi | |
- name: Make our build scripts executable | |
run: chmod +x ./scripts/build.sh | |
- name: Run build | |
run: ./scripts/build.sh | |
- 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') | |
git push origin Build_iOS_$buildNumber | |
- name: Extract version number and changelog from newest merge commit | |
id: releasenotes | |
run: | | |
buildNumber=$(git tag --sort="v:refname" | grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g') | |
echo "tag=Build_iOS_$buildNumber" | tee /dev/stderr >> "$GITHUB_OUTPUT" | |
echo "name=Monal Beta $(git log -n 1 --merges --pretty=format:%s | sed -E 's/^[\t\n ]*([^\n\t ]+)[\t\n ]+\(([^\n\t ]+)\)[\t\n ]*$/\1 (Build '$buildNumber', PR \2)/g')" | tee /dev/stderr >> "$GITHUB_OUTPUT" | |
echo "notes<<__EOF__" | tee /dev/stderr >> "$GITHUB_OUTPUT" | |
echo "$(git log -n 1 --merges --pretty=format:%b)" | tee /dev/stderr >> "$GITHUB_OUTPUT" | |
echo "__EOF__" | tee /dev/stderr >> "$GITHUB_OUTPUT" | |
- name: Publish ios to appstore connect | |
#run: xcrun altool --upload-app -f ./Monal/build/ipa/Monal.ipa --type ios --asc-provider S8D843U34Y --team-id S8D843U34Y -u "$(cat /Users/ci/apple_connect_upload_mail.txt)" -p "$(cat /Users/ci/apple_connect_upload_secret.txt)" | |
run: | | |
notes=$(printf '%s\n' "${{ steps.releasenotes.outputs.notes }}" | jq -sRr @sh) | |
fastlane run upload_to_testflight api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" changelog:$notes 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 ../../../.. | |
- 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 | |
run: | | |
notes=$(printf '%s\n' "${{ steps.releasenotes.outputs.notes }}" | jq -sRr @sh) | |
fastlane run upload_to_testflight api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" changelog:$notes 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 | |
- 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 | |
- 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: 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: | | |
New Betarelease: ${{ needs.buildAndPublishBeta.outputs.release-name }} | |
${{ needs.buildAndPublishBeta.outputs.release-changelog }} |