From 726818a818fcb2e978d5ecad1a8053704c1c428f Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 24 Jan 2023 20:00:48 -0800 Subject: [PATCH 01/11] feat(release): document manual release procedure Co-authored-by: Akos Kitta Co-authored-by: per1234 Signed-off-by: Akos Kitta --- docs/internal/Ubuntu.md | 1 + docs/internal/release-procedure.md | 124 +++++++++++++++++++++++++++++ package.json | 3 +- scripts/merge-channel-files.js | 48 +++++++++++ scripts/update-version.js | 2 + 5 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 scripts/merge-channel-files.js diff --git a/docs/internal/Ubuntu.md b/docs/internal/Ubuntu.md index de556410c..9fafe36e5 100644 --- a/docs/internal/Ubuntu.md +++ b/docs/internal/Ubuntu.md @@ -16,6 +16,7 @@ sudo apt update \ libx11-dev \ libxkbfile-dev \ build-essential \ + libsecret-1-dev \ && wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \ && source ~/.bashrc \ && nvm install 16 \ diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index 0f62d8ffa..21d9fb841 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -174,3 +174,127 @@ git push origin version- ``` replacing `` with the version you want. Then create a PR and merge it. + +## Manual build + +Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github.com/arduino/arduino-ide/issues/2018)) and macOS M1 ([arduino/arduino-ide#408](https://github.com/arduino/arduino-ide/issues/408)) is a manual procedure. + +### Ubuntu 18.04 + - Prerequisites: + - Ask the DevOps team for an EC2 instance with at least 8 GB of RAM. + - Your account must have access to the staging environment. + - You have VPN connection to staging. + - Setup: + - To install all required dependencies, run the following script: + ```sh + sudo apt update \ + && sudo apt install --no-install-recommends --yes \ + git \ + gcc \ + curl \ + make \ + python \ + pkg-config \ + libx11-dev \ + libxkbfile-dev \ + build-essential \ + libsecret-1-dev \ + && wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \ + && source ~/.bashrc \ + && nvm install 16 \ + && nvm use 16 \ + && nvm alias default 16 \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list \ + && sudo apt update && sudo apt install --no-install-recommends yarn + ``` + - Set the environment variables to mimic a CI build: + ```sh + export IS_RELEASE=true && export CI=true + ``` + - Build: + ```sh + yarn --cwd ./electron/packager && yarn --cwd ./electron/packager package + ``` + - Artifacts: + - You have to upload the following artifacts from `./arduino-ide/electron/build/dist` to S3: + - `arduino-ide_${VERSION}_Linux_64bit.AppImage`, + - `arduino-ide_${VERSION}_Linux_64bit.zip`, and + - `stable-linux.yml` + +### macOS M1 + - Prerequisites: + - You need access to the shared Mac Mini at Toolbox. Use TeamViewer. + - You have access to the `FT Web Tooling` 1Password vault. + - Setup: + - Download the `Pro-IDE-Certificates.p12` file from `Arduino Pro IDE Apple Developer ID Certificate .p12 format` and put it somewhere on the Mac Mini. This example assumes you put the `.p12` file in the `arduino-ide` repository root, and your `cwd` is also in the `arduino-ide` repository root. + - The following environment variables must be available from the shell: + - `AC_PASSWORD`: Check `Arduino Apple developer ID App Specific Password` + - `AC_USERNAME`: Check `Arduino Apple developer ID App Specific Password` + - `AC_TEAM_ID`: "KT7ZWMCJT" + - `CSC_KEY_PASSWORD`: Check `Arduino Pro IDE Apple Developer ID certificate keychain password` + - `CSC_LINK`: `Pro-IDE-Certificates.p12` file on the Mac Mini + - `IS_RELEASE`: "true" + - `CAN_SIGN`: "true" + - `MACOS_FORCE_NOTARIZE`: "true" + + ```sh + export AC_PASSWORD="***" + export AC_USERNAME="***" + export AC_TEAM_ID="7KT7ZWMCJT" + export CSC_KEY_PASSWORD="***" + export CSC_LINK="`pwd`/Pro-IDE-Certificates.p12" + export IS_RELEASE="true" + export CAN_SIGN="true" + export MACOS_FORCE_NOTARIZE="true" + export CI="true" + ``` + + - Build: + ```sh + yarn --cwd ./electron/packager && yarn --cwd ./electron/packager package + ``` + + - Verify: + + Since you cannot drag and drop via TeamViewer, you will install the app from a command line. This example puts the IDE2 into the Desktop. Do **NOT** try to bypass the installation with a double click and open from the UI. The `node_modules` folder of the source code is implicitly in the `$PATH`, and you want to verify if the app is fully functional without the `node_modules` folder. + + ```sh + hdiutil attach ./electron/build/dist/arduino-ide_${VERSION}_macOS_ARM64.dmg \ + && cp -R /Volumes/Arduino\ IDE\ ${VERSION}-arm64/Arduino\ IDE.app ~/Desktop \ + && hdiutil unmount /Volumes/Arduino\ IDE\ ${VERSION}-arm64 \ + && codesign -dv --verbose=4 ~/Desktop/Arduino\ IDE.app \ + && ~/Desktop/Arduino\ IDE.app/Contents/MacOS/Arduino\ IDE + ``` + + - Cleanup: + - You **MUST** close the shell after the build. + - You **MUST** delete the `.p12` file and empty the trash afterward. + + - Artifacts: + - You have to upload the following artifacts from `./arduino-ide/electron/build/dist` to S3, but first, you must create the final channel file from the `latest-mac.yaml`: + - `arduino-ide_${VERSION}_macOS_arm64.dmg`, + - `arduino-ide_${VERSION}_macOS_arm64.zip`, and + - `stable-mac.yml` + - To create the final channel file, do the followings: + - Copy the `stable-mac.yml` file from the Mac Mini to a folder and rename it to `stable-mac-ARM64.yml`. + - Download the `stable-mac.yaml` produced by GitHub Actions from the latest release, rename it to `stable-mac-X64.yml`, and put it in the same folder where you put the file from the Mac Mini. + - Run the channel file merger: + ```sh + node ./scripts/merge-channel-files.js ./path/to/folder/with/channel/files + ``` + - You have the merged channel file that you need to upload to S3. + +### FAQ + - Q: I see no `stable` channel files, only `latest`. + - A: You forgot to set the `CI=true` environment variable. + +---- + + - Q: How to connect to the EC2 instance? + - A: DevOps will give you a temporary link to the private key. Create a file `username_ip.pem` in your cwd, copy the private key into the file, open a shell, and execute `ssh -i "username_ip.pem" username@ip`. DevOps will tell you the `username` and the `ip`. Do not forget the VPN. + +---- + + - Q: How to download the files from the EC2 instance? + - A: `scp -i username_ip.pem username@ip:/path/to/build/artifact /local/dir`. \ No newline at end of file diff --git a/package.json b/package.json index 61113c1ea..866e9ed64 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "eslint-plugin-unused-imports": "^2.0.0", "husky": "^6.0.0", "ignore-styles": "^5.0.1", - "lerna": "^7.1.4", + "js-yaml": "^4.1.0", + "lerna": "^6.1.0", "lint-staged": "^11.0.0", "node-fetch": "^2.6.1", "node-gyp": "^9.3.0", diff --git a/scripts/merge-channel-files.js b/scripts/merge-channel-files.js new file mode 100644 index 000000000..4b83905a9 --- /dev/null +++ b/scripts/merge-channel-files.js @@ -0,0 +1,48 @@ +// @ts-check + +// The script should be invoked with the path to a folder that contains the two files as an argument. The filenames in the folder should be: +// - stable-mac-X64.yml +// - stable-mac-ARM64.yml +// The merged file will be saved to the folder with the name stable-mac.yml and that file can then be uploaded to S3 +// The input files will be deleted if the `--no-cleanup` argument is missing. +// Usage `node ./scripts/merge-channel-files.js ./path/to/folder/with/channel/files --no-cleanup` + +const yaml = require('js-yaml'); +const fs = require('fs'); +const path = require('path'); + +const args = process.argv.slice(2) +if (args.length < 1) { + console.error('Missing channel files folder path argument.'); + process.exit(1); +} + +const [channelFilesFolder,] = args; +// Staging file filename suffixes are named according to `runner.arch`. +// https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context +const x86ChannelFilePath = path.join(channelFilesFolder, 'stable-mac-X64.yml'); +const arm64ChannelFilePath = path.join( + channelFilesFolder, + 'stable-mac-ARM64.yml' +); + +const x86Data = yaml.load( + fs.readFileSync(x86ChannelFilePath, { encoding: 'utf8' }) +); +const arm64Data = yaml.load( + fs.readFileSync(arm64ChannelFilePath, { encoding: 'utf8' }) +); + +const mergedData = x86Data; +mergedData['files'] = mergedData['files'].concat(arm64Data['files']); + +fs.writeFileSync( + path.join(channelFilesFolder, 'stable-mac.yml'), + yaml.dump(mergedData, { lineWidth: -1 }) +); + +// Clean up +if (!process.argv.includes('--no-cleanup')) { + fs.rmSync(x86ChannelFilePath); + fs.rmSync(arm64ChannelFilePath); +} diff --git a/scripts/update-version.js b/scripts/update-version.js index fea65ed27..32b3db5a5 100644 --- a/scripts/update-version.js +++ b/scripts/update-version.js @@ -1,5 +1,7 @@ //@ts-check +// Usage `node ./scripts/update-version.js 2.1.3` + const fs = require('fs'); const path = require('path'); const semver = require('semver'); From a84dc882936d9e64e390ab424a9424091159fc9a Mon Sep 17 00:00:00 2001 From: Akos Kitta <1405703+kittaakos@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:06:38 +0200 Subject: [PATCH 02/11] Update docs/internal/release-procedure.md Co-authored-by: per1234 --- docs/internal/release-procedure.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index 21d9fb841..d7feb1c2b 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -227,12 +227,12 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github - You need access to the shared Mac Mini at Toolbox. Use TeamViewer. - You have access to the `FT Web Tooling` 1Password vault. - Setup: - - Download the `Pro-IDE-Certificates.p12` file from `Arduino Pro IDE Apple Developer ID Certificate .p12 format` and put it somewhere on the Mac Mini. This example assumes you put the `.p12` file in the `arduino-ide` repository root, and your `cwd` is also in the `arduino-ide` repository root. + - Download the `Pro-IDE-Certificates.p12` file from the `Arduino Pro IDE Apple Developer ID Certificate .p12 format` 1Password vault item and put it somewhere on the Mac Mini. This example assumes you put the `.p12` file in the `arduino-ide` repository root, and your `cwd` is also in the `arduino-ide` repository root. - The following environment variables must be available from the shell: - - `AC_PASSWORD`: Check `Arduino Apple developer ID App Specific Password` - - `AC_USERNAME`: Check `Arduino Apple developer ID App Specific Password` + - `AC_PASSWORD`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item + - `AC_USERNAME`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item - `AC_TEAM_ID`: "KT7ZWMCJT" - - `CSC_KEY_PASSWORD`: Check `Arduino Pro IDE Apple Developer ID certificate keychain password` + - `CSC_KEY_PASSWORD`: from the `Arduino Pro IDE Apple Developer ID certificate keychain password` 1Password vault item - `CSC_LINK`: `Pro-IDE-Certificates.p12` file on the Mac Mini - `IS_RELEASE`: "true" - `CAN_SIGN`: "true" From bce12ddbb43009616532201bb235cb234f7a61c4 Mon Sep 17 00:00:00 2001 From: Akos Kitta <1405703+kittaakos@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:06:45 +0200 Subject: [PATCH 03/11] Update docs/internal/release-procedure.md Co-authored-by: per1234 --- docs/internal/release-procedure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index d7feb1c2b..3f5be181c 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -233,7 +233,7 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github - `AC_USERNAME`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item - `AC_TEAM_ID`: "KT7ZWMCJT" - `CSC_KEY_PASSWORD`: from the `Arduino Pro IDE Apple Developer ID certificate keychain password` 1Password vault item - - `CSC_LINK`: `Pro-IDE-Certificates.p12` file on the Mac Mini + - `CSC_LINK`: Path to the `Pro-IDE-Certificates.p12` file on the Mac Mini - `IS_RELEASE`: "true" - `CAN_SIGN`: "true" - `MACOS_FORCE_NOTARIZE`: "true" From ebb115c0e42baf89645ac94e08112461f8dba713 Mon Sep 17 00:00:00 2001 From: Akos Kitta <1405703+kittaakos@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:06:58 +0200 Subject: [PATCH 04/11] Update docs/internal/release-procedure.md Co-authored-by: per1234 --- docs/internal/release-procedure.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index 3f5be181c..aca9bdbf8 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -260,7 +260,8 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github Since you cannot drag and drop via TeamViewer, you will install the app from a command line. This example puts the IDE2 into the Desktop. Do **NOT** try to bypass the installation with a double click and open from the UI. The `node_modules` folder of the source code is implicitly in the `$PATH`, and you want to verify if the app is fully functional without the `node_modules` folder. ```sh - hdiutil attach ./electron/build/dist/arduino-ide_${VERSION}_macOS_ARM64.dmg \ + VERSION="" + && hdiutil attach ./electron/build/dist/arduino-ide_${VERSION}_macOS_ARM64.dmg \ && cp -R /Volumes/Arduino\ IDE\ ${VERSION}-arm64/Arduino\ IDE.app ~/Desktop \ && hdiutil unmount /Volumes/Arduino\ IDE\ ${VERSION}-arm64 \ && codesign -dv --verbose=4 ~/Desktop/Arduino\ IDE.app \ From 24b02129cb3061890aa6b34657f219c52da2f1d8 Mon Sep 17 00:00:00 2001 From: Akos Kitta <1405703+kittaakos@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:07:09 +0200 Subject: [PATCH 05/11] Update docs/internal/release-procedure.md Co-authored-by: per1234 --- docs/internal/release-procedure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index aca9bdbf8..a95e71340 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -182,7 +182,7 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github ### Ubuntu 18.04 - Prerequisites: - Ask the DevOps team for an EC2 instance with at least 8 GB of RAM. - - Your account must have access to the staging environment. + - Your account must have access to the staging AWS environment. - You have VPN connection to staging. - Setup: - To install all required dependencies, run the following script: From 6722972e7041f7e2898f25377eb9a3d4ea6a6ee9 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 25 Aug 2023 10:28:00 +0200 Subject: [PATCH 06/11] fix: macos clone+build ran prettier on the readme --- docs/internal/release-procedure.md | 224 ++++++++++++++++------------- 1 file changed, 121 insertions(+), 103 deletions(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index a95e71340..a64252a1b 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -180,122 +180,140 @@ replacing `` with the version you want. Then create a PR and merge Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github.com/arduino/arduino-ide/issues/2018)) and macOS M1 ([arduino/arduino-ide#408](https://github.com/arduino/arduino-ide/issues/408)) is a manual procedure. ### Ubuntu 18.04 - - Prerequisites: - - Ask the DevOps team for an EC2 instance with at least 8 GB of RAM. - - Your account must have access to the staging AWS environment. - - You have VPN connection to staging. - - Setup: - - To install all required dependencies, run the following script: - ```sh - sudo apt update \ - && sudo apt install --no-install-recommends --yes \ - git \ - gcc \ - curl \ - make \ - python \ - pkg-config \ - libx11-dev \ - libxkbfile-dev \ - build-essential \ - libsecret-1-dev \ - && wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \ - && source ~/.bashrc \ - && nvm install 16 \ - && nvm use 16 \ - && nvm alias default 16 \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list \ - && sudo apt update && sudo apt install --no-install-recommends yarn - ``` - - Set the environment variables to mimic a CI build: - ```sh - export IS_RELEASE=true && export CI=true - ``` - - Build: + +- Prerequisites: + - Ask the DevOps team for an EC2 instance with at least 8 GB of RAM. + - Your account must have access to the staging AWS environment. + - You have VPN connection to staging. +- Setup: + - To install all required dependencies, run the following script: ```sh - yarn --cwd ./electron/packager && yarn --cwd ./electron/packager package + sudo apt update \ + && sudo apt install --no-install-recommends --yes \ + git \ + gcc \ + curl \ + make \ + python \ + pkg-config \ + libx11-dev \ + libxkbfile-dev \ + build-essential \ + libsecret-1-dev \ + && wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \ + && source ~/.bashrc \ + && nvm install 16 \ + && nvm use 16 \ + && nvm alias default 16 \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list \ + && sudo apt update && sudo apt install --no-install-recommends yarn ``` - - Artifacts: - - You have to upload the following artifacts from `./arduino-ide/electron/build/dist` to S3: - - `arduino-ide_${VERSION}_Linux_64bit.AppImage`, - - `arduino-ide_${VERSION}_Linux_64bit.zip`, and - - `stable-linux.yml` - -### macOS M1 - - Prerequisites: - - You need access to the shared Mac Mini at Toolbox. Use TeamViewer. - - You have access to the `FT Web Tooling` 1Password vault. - - Setup: - - Download the `Pro-IDE-Certificates.p12` file from the `Arduino Pro IDE Apple Developer ID Certificate .p12 format` 1Password vault item and put it somewhere on the Mac Mini. This example assumes you put the `.p12` file in the `arduino-ide` repository root, and your `cwd` is also in the `arduino-ide` repository root. - - The following environment variables must be available from the shell: - - `AC_PASSWORD`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item - - `AC_USERNAME`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item - - `AC_TEAM_ID`: "KT7ZWMCJT" - - `CSC_KEY_PASSWORD`: from the `Arduino Pro IDE Apple Developer ID certificate keychain password` 1Password vault item - - `CSC_LINK`: Path to the `Pro-IDE-Certificates.p12` file on the Mac Mini - - `IS_RELEASE`: "true" - - `CAN_SIGN`: "true" - - `MACOS_FORCE_NOTARIZE`: "true" - - ```sh - export AC_PASSWORD="***" - export AC_USERNAME="***" - export AC_TEAM_ID="7KT7ZWMCJT" - export CSC_KEY_PASSWORD="***" - export CSC_LINK="`pwd`/Pro-IDE-Certificates.p12" - export IS_RELEASE="true" - export CAN_SIGN="true" - export MACOS_FORCE_NOTARIZE="true" - export CI="true" - ``` - - - Build: + - Set the environment variables to mimic a CI build: ```sh - yarn --cwd ./electron/packager && yarn --cwd ./electron/packager package + export IS_RELEASE=true && export CI=true ``` +- Build: + ```sh + yarn --cwd ./electron/packager && yarn --cwd ./electron/packager package + ``` +- Artifacts: + - You have to upload the following artifacts from `./arduino-ide/electron/build/dist` to S3: + - `arduino-ide_${VERSION}_Linux_64bit.AppImage`, + - `arduino-ide_${VERSION}_Linux_64bit.zip`, and + - `stable-linux.yml` + +### macOS M1 + +- Prerequisites: + + - You need access to the shared Mac Mini at Toolbox. Use TeamViewer. + - You have access to the `FT Web Tooling` 1Password vault. + +- Clone: + + ```sh + BRANCH="" + git clone --single-branch --branch $BRANCH https://github.com/arduino/arduino-ide.git + ``` + +- Setup: - - Verify: + - Download the `Pro-IDE-Certificates.p12` file from the `Arduino Pro IDE Apple Developer ID Certificate .p12 format` 1Password vault item and put it somewhere on the Mac Mini. This example assumes you put the `.p12` file in the `arduino-ide` repository root, and your `cwd` is also in the `arduino-ide` repository root. + - The following environment variables must be available from the shell: - Since you cannot drag and drop via TeamViewer, you will install the app from a command line. This example puts the IDE2 into the Desktop. Do **NOT** try to bypass the installation with a double click and open from the UI. The `node_modules` folder of the source code is implicitly in the `$PATH`, and you want to verify if the app is fully functional without the `node_modules` folder. + - `AC_PASSWORD`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item + - `AC_USERNAME`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item + - `AC_TEAM_ID`: "KT7ZWMCJT" + - `CSC_KEY_PASSWORD`: from the `Arduino Pro IDE Apple Developer ID certificate keychain password` 1Password vault item + - `CSC_LINK`: Path to the `Pro-IDE-Certificates.p12` file on the Mac Mini + - `IS_RELEASE`: "true" + - `CAN_SIGN`: "true" + - `MACOS_FORCE_NOTARIZE`: "true" ```sh - VERSION="" - && hdiutil attach ./electron/build/dist/arduino-ide_${VERSION}_macOS_ARM64.dmg \ - && cp -R /Volumes/Arduino\ IDE\ ${VERSION}-arm64/Arduino\ IDE.app ~/Desktop \ - && hdiutil unmount /Volumes/Arduino\ IDE\ ${VERSION}-arm64 \ - && codesign -dv --verbose=4 ~/Desktop/Arduino\ IDE.app \ - && ~/Desktop/Arduino\ IDE.app/Contents/MacOS/Arduino\ IDE + export AC_PASSWORD="***" + export AC_USERNAME="***" + export AC_TEAM_ID="7KT7ZWMCJT" + export CSC_KEY_PASSWORD="***" + export CSC_LINK="`pwd`/Pro-IDE-Certificates.p12" + export IS_RELEASE="true" + export CAN_SIGN="true" + export MACOS_FORCE_NOTARIZE="true" + export CI="true" ``` - - Cleanup: - - You **MUST** close the shell after the build. - - You **MUST** delete the `.p12` file and empty the trash afterward. - - - Artifacts: - - You have to upload the following artifacts from `./arduino-ide/electron/build/dist` to S3, but first, you must create the final channel file from the `latest-mac.yaml`: - - `arduino-ide_${VERSION}_macOS_arm64.dmg`, - - `arduino-ide_${VERSION}_macOS_arm64.zip`, and - - `stable-mac.yml` - - To create the final channel file, do the followings: - - Copy the `stable-mac.yml` file from the Mac Mini to a folder and rename it to `stable-mac-ARM64.yml`. - - Download the `stable-mac.yaml` produced by GitHub Actions from the latest release, rename it to `stable-mac-X64.yml`, and put it in the same folder where you put the file from the Mac Mini. - - Run the channel file merger: - ```sh - node ./scripts/merge-channel-files.js ./path/to/folder/with/channel/files - ``` - - You have the merged channel file that you need to upload to S3. +- Build: + + ```sh + ./scripts/package.sh + ``` + + > Make sure to change directory, and execute the script from the root of the `arduino-ide` repository. + +- Verify: + + Since you cannot drag and drop via TeamViewer, you will install the app from a command line. This example puts the IDE2 into the Desktop. Do **NOT** try to bypass the installation with a double click and open from the UI. The `node_modules` folder of the source code is implicitly in the `$PATH`, and you want to verify if the app is fully functional without the `node_modules` folder. + + ```sh + VERSION="" + hdiutil attach ./electron/build/dist/arduino-ide_$VERSION_macOS_ARM64.dmg \ + && cp -R /Volumes/Arduino\ IDE\ $VERSION-arm64/Arduino\ IDE.app ~/Desktop \ + && hdiutil unmount /Volumes/Arduino\ IDE\ $VERSION-arm64 \ + && codesign -dv --verbose=4 ~/Desktop/Arduino\ IDE.app \ + && ~/Desktop/Arduino\ IDE.app/Contents/MacOS/Arduino\ IDE + ``` + +- Cleanup: + + - You **MUST** close the shell after the build. + - You **MUST** delete the `.p12` file and empty the trash afterward. + +- Artifacts: + - You have to upload the following artifacts from `./arduino-ide/electron/build/dist` to S3, but first, you must create the final channel file from the `latest-mac.yaml`: + - `arduino-ide_${VERSION}_macOS_arm64.dmg`, + - `arduino-ide_${VERSION}_macOS_arm64.zip`, and + - `stable-mac.yml` + - To create the final channel file, do the followings: + - Copy the `stable-mac.yml` file from the Mac Mini to a folder and rename it to `stable-mac-ARM64.yml`. + - Download the `stable-mac.yaml` produced by GitHub Actions from the latest release, rename it to `stable-mac-X64.yml`, and put it in the same folder where you put the file from the Mac Mini. + - Run the channel file merger: + ```sh + node ./scripts/merge-channel-files.js ./path/to/folder/with/channel/files + ``` + - You have the merged channel file that you need to upload to S3. ### FAQ - - Q: I see no `stable` channel files, only `latest`. - - A: You forgot to set the `CI=true` environment variable. ----- +- Q: I see no `stable` channel files, only `latest`. +- A: You forgot to set the `CI=true` environment variable. + +--- - - Q: How to connect to the EC2 instance? - - A: DevOps will give you a temporary link to the private key. Create a file `username_ip.pem` in your cwd, copy the private key into the file, open a shell, and execute `ssh -i "username_ip.pem" username@ip`. DevOps will tell you the `username` and the `ip`. Do not forget the VPN. +- Q: How to connect to the EC2 instance? +- A: DevOps will give you a temporary link to the private key. Create a file `username_ip.pem` in your cwd, copy the private key into the file, open a shell, and execute `ssh -i "username_ip.pem" username@ip`. DevOps will tell you the `username` and the `ip`. Do not forget the VPN. ----- +--- - - Q: How to download the files from the EC2 instance? - - A: `scp -i username_ip.pem username@ip:/path/to/build/artifact /local/dir`. \ No newline at end of file +- Q: How to download the files from the EC2 instance? +- A: `scp -i username_ip.pem username@ip:/path/to/build/artifact /local/dir`. From cddb18e11e5d3367825a856fc3cfd48422900f5f Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 25 Aug 2023 10:47:06 +0200 Subject: [PATCH 07/11] fix: release artifact folder path --- docs/internal/release-procedure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index a64252a1b..e6be1e3c2 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -218,7 +218,7 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github yarn --cwd ./electron/packager && yarn --cwd ./electron/packager package ``` - Artifacts: - - You have to upload the following artifacts from `./arduino-ide/electron/build/dist` to S3: + - You have to upload the following artifacts from `./arduino-ide/electron-app/dist` to S3: - `arduino-ide_${VERSION}_Linux_64bit.AppImage`, - `arduino-ide_${VERSION}_Linux_64bit.zip`, and - `stable-linux.yml` @@ -277,7 +277,7 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github ```sh VERSION="" - hdiutil attach ./electron/build/dist/arduino-ide_$VERSION_macOS_ARM64.dmg \ + hdiutil attach ./electron-app/dist/arduino-ide_$VERSION_macOS_ARM64.dmg \ && cp -R /Volumes/Arduino\ IDE\ $VERSION-arm64/Arduino\ IDE.app ~/Desktop \ && hdiutil unmount /Volumes/Arduino\ IDE\ $VERSION-arm64 \ && codesign -dv --verbose=4 ~/Desktop/Arduino\ IDE.app \ @@ -290,7 +290,7 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github - You **MUST** delete the `.p12` file and empty the trash afterward. - Artifacts: - - You have to upload the following artifacts from `./arduino-ide/electron/build/dist` to S3, but first, you must create the final channel file from the `latest-mac.yaml`: + - You have to upload the following artifacts from `./arduino-ide/electron-app/dist` to S3, but first, you must create the final channel file from the `latest-mac.yaml`: - `arduino-ide_${VERSION}_macOS_arm64.dmg`, - `arduino-ide_${VERSION}_macOS_arm64.zip`, and - `stable-mac.yml` From c7d8e8881b0d55ea3216fbb75d9cfb574a9079cd Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 25 Aug 2023 10:49:44 +0200 Subject: [PATCH 08/11] fix: keep the original files --- docs/internal/release-procedure.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index e6be1e3c2..cf0b6c152 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -299,8 +299,9 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github - Download the `stable-mac.yaml` produced by GitHub Actions from the latest release, rename it to `stable-mac-X64.yml`, and put it in the same folder where you put the file from the Mac Mini. - Run the channel file merger: ```sh - node ./scripts/merge-channel-files.js ./path/to/folder/with/channel/files + node ./scripts/merge-channel-files.js ./path/to/folder/with/channel/files --no-cleanup ``` + > Although, the `--no-cleanup` flag is not mandatory to merge the channel files, it instructs the merger to keep the original channel files. - You have the merged channel file that you need to upload to S3. ### FAQ From 1a34e50ed994c7e7910c236c120a6baf9fd36341 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 25 Aug 2023 11:05:09 +0200 Subject: [PATCH 09/11] fix: macos verify step --- docs/internal/release-procedure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index cf0b6c152..e2d241dd2 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -277,9 +277,9 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github ```sh VERSION="" - hdiutil attach ./electron-app/dist/arduino-ide_$VERSION_macOS_ARM64.dmg \ - && cp -R /Volumes/Arduino\ IDE\ $VERSION-arm64/Arduino\ IDE.app ~/Desktop \ - && hdiutil unmount /Volumes/Arduino\ IDE\ $VERSION-arm64 \ + hdiutil attach ./electron-app/dist/arduino-ide_${VERSION}_macOS_arm64.dmg \ + && cp -R /Volumes/Arduino\ IDE\ ${VERSION}-arm64/Arduino\ IDE.app ~/Desktop \ + && hdiutil unmount /Volumes/Arduino\ IDE\ ${VERSION}-arm64 \ && codesign -dv --verbose=4 ~/Desktop/Arduino\ IDE.app \ && ~/Desktop/Arduino\ IDE.app/Contents/MacOS/Arduino\ IDE ``` From 8959aec387b996edd37d7de58430e8ba87652a3a Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 25 Aug 2023 12:02:21 +0200 Subject: [PATCH 10/11] fix: added clone step +update build step on Linux --- docs/internal/release-procedure.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index e2d241dd2..89768c471 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -186,6 +186,7 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github - Your account must have access to the staging AWS environment. - You have VPN connection to staging. - Setup: + - To install all required dependencies, run the following script: ```sh sudo apt update \ @@ -209,14 +210,22 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list \ && sudo apt update && sudo apt install --no-install-recommends yarn ``` - - Set the environment variables to mimic a CI build: - ```sh - export IS_RELEASE=true && export CI=true - ``` + +- Clone: + + ```sh + BRANCH="" + git clone --single-branch --branch $BRANCH https://github.com/arduino/arduino-ide.git + ``` + - Build: + ```sh - yarn --cwd ./electron/packager && yarn --cwd ./electron/packager package + export IS_RELEASE=true \ + && export CI=true \ + && ./scripts/package.sh ``` + - Artifacts: - You have to upload the following artifacts from `./arduino-ide/electron-app/dist` to S3: - `arduino-ide_${VERSION}_Linux_64bit.AppImage`, From 9d99d1484d35f84fd8bdb492b7f77e58fe480d71 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 4 Oct 2023 09:56:33 -0700 Subject: [PATCH 11/11] Update manual release procedure documentation to reflect implementation of automated builds for macOS ARM Previously, the production of the builds for the Apple Silicon host target was a manual procedure. This was done due to the lack of availability of GitHub hosted runner machines of that architecture. Fortunately such runners are now available, which allowed us to set up automated builds for this target. For this reason, it is no longer necessary to maintain documentation of the manual release procedure for that target. --- docs/internal/release-procedure.md | 85 +----------------------------- package.json | 3 +- scripts/merge-channel-files.js | 48 ----------------- 3 files changed, 2 insertions(+), 134 deletions(-) delete mode 100644 scripts/merge-channel-files.js diff --git a/docs/internal/release-procedure.md b/docs/internal/release-procedure.md index 89768c471..ce4daf2a7 100644 --- a/docs/internal/release-procedure.md +++ b/docs/internal/release-procedure.md @@ -177,9 +177,7 @@ replacing `` with the version you want. Then create a PR and merge ## Manual build -Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github.com/arduino/arduino-ide/issues/2018)) and macOS M1 ([arduino/arduino-ide#408](https://github.com/arduino/arduino-ide/issues/408)) is a manual procedure. - -### Ubuntu 18.04 +Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github.com/arduino/arduino-ide/issues/2018)) is a manual procedure: - Prerequisites: - Ask the DevOps team for an EC2 instance with at least 8 GB of RAM. @@ -232,87 +230,6 @@ Creating the release for Ubuntu 18.04 ([arduino/arduino-ide#2018](https://github - `arduino-ide_${VERSION}_Linux_64bit.zip`, and - `stable-linux.yml` -### macOS M1 - -- Prerequisites: - - - You need access to the shared Mac Mini at Toolbox. Use TeamViewer. - - You have access to the `FT Web Tooling` 1Password vault. - -- Clone: - - ```sh - BRANCH="" - git clone --single-branch --branch $BRANCH https://github.com/arduino/arduino-ide.git - ``` - -- Setup: - - - Download the `Pro-IDE-Certificates.p12` file from the `Arduino Pro IDE Apple Developer ID Certificate .p12 format` 1Password vault item and put it somewhere on the Mac Mini. This example assumes you put the `.p12` file in the `arduino-ide` repository root, and your `cwd` is also in the `arduino-ide` repository root. - - The following environment variables must be available from the shell: - - - `AC_PASSWORD`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item - - `AC_USERNAME`: From the `Arduino Apple developer ID App Specific Password` 1Password vault item - - `AC_TEAM_ID`: "KT7ZWMCJT" - - `CSC_KEY_PASSWORD`: from the `Arduino Pro IDE Apple Developer ID certificate keychain password` 1Password vault item - - `CSC_LINK`: Path to the `Pro-IDE-Certificates.p12` file on the Mac Mini - - `IS_RELEASE`: "true" - - `CAN_SIGN`: "true" - - `MACOS_FORCE_NOTARIZE`: "true" - - ```sh - export AC_PASSWORD="***" - export AC_USERNAME="***" - export AC_TEAM_ID="7KT7ZWMCJT" - export CSC_KEY_PASSWORD="***" - export CSC_LINK="`pwd`/Pro-IDE-Certificates.p12" - export IS_RELEASE="true" - export CAN_SIGN="true" - export MACOS_FORCE_NOTARIZE="true" - export CI="true" - ``` - -- Build: - - ```sh - ./scripts/package.sh - ``` - - > Make sure to change directory, and execute the script from the root of the `arduino-ide` repository. - -- Verify: - - Since you cannot drag and drop via TeamViewer, you will install the app from a command line. This example puts the IDE2 into the Desktop. Do **NOT** try to bypass the installation with a double click and open from the UI. The `node_modules` folder of the source code is implicitly in the `$PATH`, and you want to verify if the app is fully functional without the `node_modules` folder. - - ```sh - VERSION="" - hdiutil attach ./electron-app/dist/arduino-ide_${VERSION}_macOS_arm64.dmg \ - && cp -R /Volumes/Arduino\ IDE\ ${VERSION}-arm64/Arduino\ IDE.app ~/Desktop \ - && hdiutil unmount /Volumes/Arduino\ IDE\ ${VERSION}-arm64 \ - && codesign -dv --verbose=4 ~/Desktop/Arduino\ IDE.app \ - && ~/Desktop/Arduino\ IDE.app/Contents/MacOS/Arduino\ IDE - ``` - -- Cleanup: - - - You **MUST** close the shell after the build. - - You **MUST** delete the `.p12` file and empty the trash afterward. - -- Artifacts: - - You have to upload the following artifacts from `./arduino-ide/electron-app/dist` to S3, but first, you must create the final channel file from the `latest-mac.yaml`: - - `arduino-ide_${VERSION}_macOS_arm64.dmg`, - - `arduino-ide_${VERSION}_macOS_arm64.zip`, and - - `stable-mac.yml` - - To create the final channel file, do the followings: - - Copy the `stable-mac.yml` file from the Mac Mini to a folder and rename it to `stable-mac-ARM64.yml`. - - Download the `stable-mac.yaml` produced by GitHub Actions from the latest release, rename it to `stable-mac-X64.yml`, and put it in the same folder where you put the file from the Mac Mini. - - Run the channel file merger: - ```sh - node ./scripts/merge-channel-files.js ./path/to/folder/with/channel/files --no-cleanup - ``` - > Although, the `--no-cleanup` flag is not mandatory to merge the channel files, it instructs the merger to keep the original channel files. - - You have the merged channel file that you need to upload to S3. - ### FAQ - Q: I see no `stable` channel files, only `latest`. diff --git a/package.json b/package.json index 866e9ed64..61113c1ea 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,7 @@ "eslint-plugin-unused-imports": "^2.0.0", "husky": "^6.0.0", "ignore-styles": "^5.0.1", - "js-yaml": "^4.1.0", - "lerna": "^6.1.0", + "lerna": "^7.1.4", "lint-staged": "^11.0.0", "node-fetch": "^2.6.1", "node-gyp": "^9.3.0", diff --git a/scripts/merge-channel-files.js b/scripts/merge-channel-files.js deleted file mode 100644 index 4b83905a9..000000000 --- a/scripts/merge-channel-files.js +++ /dev/null @@ -1,48 +0,0 @@ -// @ts-check - -// The script should be invoked with the path to a folder that contains the two files as an argument. The filenames in the folder should be: -// - stable-mac-X64.yml -// - stable-mac-ARM64.yml -// The merged file will be saved to the folder with the name stable-mac.yml and that file can then be uploaded to S3 -// The input files will be deleted if the `--no-cleanup` argument is missing. -// Usage `node ./scripts/merge-channel-files.js ./path/to/folder/with/channel/files --no-cleanup` - -const yaml = require('js-yaml'); -const fs = require('fs'); -const path = require('path'); - -const args = process.argv.slice(2) -if (args.length < 1) { - console.error('Missing channel files folder path argument.'); - process.exit(1); -} - -const [channelFilesFolder,] = args; -// Staging file filename suffixes are named according to `runner.arch`. -// https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context -const x86ChannelFilePath = path.join(channelFilesFolder, 'stable-mac-X64.yml'); -const arm64ChannelFilePath = path.join( - channelFilesFolder, - 'stable-mac-ARM64.yml' -); - -const x86Data = yaml.load( - fs.readFileSync(x86ChannelFilePath, { encoding: 'utf8' }) -); -const arm64Data = yaml.load( - fs.readFileSync(arm64ChannelFilePath, { encoding: 'utf8' }) -); - -const mergedData = x86Data; -mergedData['files'] = mergedData['files'].concat(arm64Data['files']); - -fs.writeFileSync( - path.join(channelFilesFolder, 'stable-mac.yml'), - yaml.dump(mergedData, { lineWidth: -1 }) -); - -// Clean up -if (!process.argv.includes('--no-cleanup')) { - fs.rmSync(x86ChannelFilePath); - fs.rmSync(arm64ChannelFilePath); -}