From 8d712e73316e002e8b138cd4f628fc3568bdc618 Mon Sep 17 00:00:00 2001 From: Lucas Manuel Rodriguez Date: Thu, 11 Sep 2025 17:06:23 -0300 Subject: [PATCH] Add support and docs to release updates to swiftDialog (#32882) For #32869. --- tools/tuf/README.md | 20 +++++++++++++++----- tools/tuf/releaser.sh | 27 ++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/tools/tuf/README.md b/tools/tuf/README.md index 31155baa8e..849e39e05c 100644 --- a/tools/tuf/README.md +++ b/tools/tuf/README.md @@ -248,16 +248,26 @@ VERSION=5.19.0 \ #### Releasing `swiftDialog` to `stable` -> `releaser.sh` doesn't support `swiftDialog` yet. > macOS only component -The `swiftDialog` executable can be generated from a macOS host by running: +1. Download `swiftDialog` from the desired run of https://github.com/fleetdm/fleet/actions/workflows/generate-swift-dialog-targets.yml. +2. Extract the downloaded `.zip` to `/path/to/swiftDialog.app.tar.gz` +3. Push to staging: ```sh -make swift-dialog-app-tar-gz version=2.2.1 build=4591 out-path=. +TUF_DIRECTORY=/Users/foobar/updates-staging.fleetdm.com \ +ACTION=release-swiftDialog-to-stable \ +VERSION=2.5.6 \ +KEYS_SOURCE_DIRECTORY=/Volumes/FLEET-UPD/keys \ +TARGETS_PASSPHRASE_1PASSWORD_PATH="Private/UPDATES TARGETS/password" \ +SNAPSHOT_PASSPHRASE_1PASSWORD_PATH="Private/UPDATES SNAPSHOT/password" \ +TIMESTAMP_PASSPHRASE_1PASSWORD_PATH="Private/UPDATES TIMESTAMP/password" \ +SWIFT_DIALOG_PATH=/path/to/swiftDialog.app.tar.gz \ +./tools/tuf/releaser.sh ``` +4. Push to production: ```sh -fleetctl updates add --target /path/to/macos/swiftDialog.app.tar.gz --platform macos --name swiftDialog --version 2.2.1 -t edge -``` +ACTION=release-to-production ./tools/tuf/releaser.sh +``` #### Releasing `nudge` to `stable` diff --git a/tools/tuf/releaser.sh b/tools/tuf/releaser.sh index ed7ee15e62..e6b1bc23d6 100755 --- a/tools/tuf/releaser.sh +++ b/tools/tuf/releaser.sh @@ -53,7 +53,7 @@ setup () { # Passphrases need to be exported for use by `fleetctl updates` commands. # - if [[ $ACTION == "release-to-edge" ]] || [[ $ACTION == "promote-edge-to-stable" ]]; then + if [[ $ACTION == "release-to-edge" ]] || [[ $ACTION == "promote-edge-to-stable" ]] || [[ $ACTION == "release-swiftDialog-to-stable" ]]; then FLEET_TARGETS_PASSPHRASE=$(op read "op://$TARGETS_PASSPHRASE_1PASSWORD_PATH") export FLEET_TARGETS_PASSPHRASE FLEET_SNAPSHOT_PASSPHRASE=$(op read "op://$SNAPSHOT_PASSPHRASE_1PASSWORD_PATH") @@ -340,6 +340,8 @@ print_reminder () { : elif [[ $ACTION == "update-osquery-schema" ]]; then : + elif [[ $ACTION == "release-swiftDialog-to-stable" ]]; then + prompt "We don't have/use edge channel for swiftDialog, so (currently) we can only release to stable." else echo "Unsupported action: $ACTION" exit 1 @@ -352,6 +354,12 @@ fleetctl_version_check () { prompt "Make sure the fleetctl executable and version are correct." } +release_swiftDialog_to_stable () { + pushd "$TUF_DIRECTORY" + "$GIT_REPOSITORY_DIRECTORY/build/fleetctl" updates add --target "$SWIFT_DIALOG_PATH" --platform macos --name swiftDialog --version "$VERSION" -t stable + popd +} + print_reminder if [[ $ACTION == "release-to-edge" ]]; then @@ -368,6 +376,23 @@ elif [[ $ACTION == "promote-edge-to-stable" ]]; then pull_from_staging promote_edge_to_stable push_to_staging +elif [[ $ACTION == "release-swiftDialog-to-stable" ]]; then + if [[ -z $SWIFT_DIALOG_PATH ]]; then + echo "Missing $SWIFT_DIALOG_PATH" + exit 1 + fi + + if [ ! -f "$SWIFT_DIALOG_PATH" ]; then + echo "Path SWIFT_DIALOG_PATH='$SWIFT_DIALOG_PATH' does not exist or is not accessible." + fi + prompt "Using $SWIFT_DIALOG_PATH" + + trap clean_up EXIT + setup + fleetctl_version_check + pull_from_staging + release_swiftDialog_to_stable + push_to_staging elif [[ $ACTION == "update-timestamp" ]]; then trap clean_up EXIT setup