|
| 1 | +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json |
| 2 | +# |
| 3 | +# Release build and distribution pipeline. |
| 4 | +# |
| 5 | +# Triggered as a separate Buildkite build by the fastlane lanes (code_freeze, new_beta_release, |
| 6 | +# finalize_release) via `buildkite_add_trigger_step` / `buildkite_trigger_build`. |
| 7 | +# |
| 8 | +# Expects `RELEASE_VERSION` env var to be set (e.g., '1.7.4'). |
| 9 | +# Each step checks out the release branch to ensure it builds the latest commit. |
| 10 | +--- |
| 11 | + |
| 12 | +# Used by mac agents only |
| 13 | +env: |
| 14 | + IMAGE_ID: $IMAGE_ID |
| 15 | + |
| 16 | +steps: |
| 17 | + - group: 📦 Build for Mac |
| 18 | + key: release-mac |
| 19 | + steps: |
| 20 | + - label: 🔨 Mac Release Build - {{matrix}} |
| 21 | + agents: |
| 22 | + queue: mac |
| 23 | + command: | |
| 24 | + .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" |
| 25 | +
|
| 26 | + .buildkite/commands/prepare-environment.sh |
| 27 | +
|
| 28 | + .buildkite/commands/install-node-dependencies.sh |
| 29 | +
|
| 30 | + echo "--- :node: Building Binary" |
| 31 | + npm run make:macos-{{matrix}} |
| 32 | +
|
| 33 | + # Local trial and error show this needs to run before the DMG generation (obviously) but after the binary has been built |
| 34 | + echo "--- :hammer: Rebuild fs-attr if necessary before generating DMG" |
| 35 | + case {{matrix}} in |
| 36 | + x64) |
| 37 | + echo "Rebuilding fs-xattr for {{matrix}} architecture" |
| 38 | + npm rebuild fs-xattr --cpu universal |
| 39 | + ;; |
| 40 | + arm64) |
| 41 | + echo "No need to rebuild fs-xattr because it works out of the box on Apple Silicon" |
| 42 | + ;; |
| 43 | + *) |
| 44 | + echo "^^^ +++ Unexpected architecture {{matrix}}" |
| 45 | + exit 1 |
| 46 | + ;; |
| 47 | + esac |
| 48 | +
|
| 49 | + echo "--- :node: Packaging in DMG" |
| 50 | + npm run make:dmg-{{matrix}} |
| 51 | +
|
| 52 | + echo "--- 📃 Notarizing Binary" |
| 53 | + bundle exec fastlane notarize_binary |
| 54 | + plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] |
| 55 | + artifact_paths: |
| 56 | + - apps/studio/out/**/*.app.zip |
| 57 | + - apps/studio/out/*.dmg |
| 58 | + matrix: |
| 59 | + - x64 |
| 60 | + - arm64 |
| 61 | + notify: |
| 62 | + - github_commit_status: |
| 63 | + context: All Mac Release Builds |
| 64 | + |
| 65 | + - group: 📦 Build for Windows |
| 66 | + key: release-windows |
| 67 | + steps: |
| 68 | + - label: 🔨 Windows Release Build - {{matrix}} |
| 69 | + agents: |
| 70 | + queue: windows |
| 71 | + command: | |
| 72 | + bash .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" |
| 73 | + powershell -File .buildkite/commands/build-for-windows.ps1 -BuildType release -Architecture {{matrix}} |
| 74 | + artifact_paths: |
| 75 | + - apps\studio\out\**\studio-setup.exe |
| 76 | + - apps\studio\out\**\studio-update.nupkg |
| 77 | + - apps\studio\out\**\RELEASES |
| 78 | + - apps\studio\out\**\*.appx |
| 79 | + plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] |
| 80 | + matrix: |
| 81 | + - x64 |
| 82 | + - arm64 |
| 83 | + notify: |
| 84 | + - github_commit_status: |
| 85 | + context: All Windows Release Builds |
| 86 | + |
| 87 | + - label: ":rocket: Publish Release Builds" |
| 88 | + command: | |
| 89 | + echo "--- :robot_face: Use bot for Git operations" |
| 90 | + source use-bot-for-git |
| 91 | +
|
| 92 | + .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" |
| 93 | +
|
| 94 | + echo "--- :node: Downloading Binaries" |
| 95 | + buildkite-agent artifact download "*.zip" . |
| 96 | + buildkite-agent artifact download "*.dmg" . |
| 97 | + buildkite-agent artifact download "*.exe" . |
| 98 | + buildkite-agent artifact download "*.appx" . |
| 99 | + buildkite-agent artifact download "*.nupkg" . |
| 100 | + buildkite-agent artifact download "*\\RELEASES" . |
| 101 | +
|
| 102 | + .buildkite/commands/install-node-dependencies.sh |
| 103 | +
|
| 104 | + echo "--- :fastlane: Distributing Release Builds" |
| 105 | + install_gems |
| 106 | + bundle exec fastlane distribute_release_build |
| 107 | + agents: |
| 108 | + queue: mac |
| 109 | + depends_on: |
| 110 | + - step: release-mac |
| 111 | + - step: release-windows |
| 112 | + plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] |
| 113 | + notify: |
| 114 | + - github_commit_status: |
| 115 | + context: Publish Release Builds |
0 commit comments