From 46fbb343ee66a5a38bd716e59a1a96c43454b6a2 Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:35:02 +0200 Subject: [PATCH] Rename executable and releases to `Arduino Cloud Agent` (#961) * Change name in the docs * Change executable's name * Change debug console's name * Update name in test release workflow * Update name in release workflow * Change name used in the installer * Rename .app to Cloud Agent * Check that either the Create Agent or the Cloud Agent exist when autoupdating on macos * Fix typo * Revert changes on the zipped notarized app bundle uploaded to s3 We are keeping it this way because it is used by the autoupdate procedure on macos --- .github/workflows/publish-go-tester-task.yml | 2 +- .github/workflows/release.yml | 89 +-- .gitignore | 4 +- README.md | 8 +- Taskfile.yml | 8 +- home.html | 627 ++++++++++--------- tests/conftest.py | 4 +- updater/updater_darwin.go | 4 +- 8 files changed, 387 insertions(+), 359 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 54d9c04f0..aa2949e13 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -30,7 +30,7 @@ on: repository_dispatch: env: - PROJECT_NAME: arduino-create-agent + PROJECT_NAME: arduino-cloud-agent GO_VERSION: "1.21" jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72b07c468..fe60ec8f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ permissions: env: # As defined by the Taskfile's PROJECT_NAME variable - PROJECT_NAME: arduino-create-agent + PROJECT_NAME: arduino-cloud-agent TARGET: "/CreateAgent/Stable/" VERSION_TARGET: "arduino-create-static/agent-metadata/" AWS_REGION: "us-east-1" # or https://github.com/aws/aws-cli/issues/5623 @@ -183,7 +183,7 @@ jobs: runs-on: macos-12 env: - EXE_PATH: "skel/ArduinoCreateAgent.app/Contents/MacOS/" + EXE_PATH: "skel/ArduinoCloudAgent.app/Contents/MacOS/" steps: - name: Checkout @@ -205,21 +205,21 @@ jobs: - name: Make executable run: chmod -v +x ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} - - name: Rename executable to Arduino_Create_Agent - run: mv -v ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} ${{ env.EXE_PATH }}Arduino_Create_Agent + - name: Rename executable to Arduino_Cloud_Agent + run: mv -v ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} ${{ env.EXE_PATH }}Arduino_Cloud_Agent - name: get year run: echo "YEAR=$(date "+%Y")" >> $GITHUB_ENV - name: Generate Info.plist for MacOS run: | - cat > skel/ArduinoCreateAgent.app/Contents/Info.plist < skel/ArduinoCloudAgent.app/Contents/Info.plist <CFBundlePackageTypeAPPLCFBundleInfoDictionaryVersion6.0 CFBundleIconFile AppIcon.icns - CFBundleName Arduino Create Agent - CFBundleExecutable Arduino_Create_Agent + CFBundleName Arduino Cloud Agent + CFBundleExecutable Arduino_Cloud_Agent CFBundleIdentifier create.arduino.cc CFBundleVersion ${GITHUB_REF##*/} @@ -234,14 +234,14 @@ jobs: EOF - name: Tar bundle to keep permissions - run: tar -cvf ArduinoCreateAgent.app_${{ matrix.arch }}.tar -C skel/ . + run: tar -cvf ArduinoCloudAgent.app_${{ matrix.arch }}.tar -C skel/ . - name: Upload artifacts uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ArduinoCreateAgent.app_${{ matrix.arch }} - path: ArduinoCreateAgent.app_${{ matrix.arch }}.tar + name: ArduinoCloudAgent.app_${{ matrix.arch }} + path: ArduinoCloudAgent.app_${{ matrix.arch }}.tar # The notarize-macos job will download the macos bundle from the previous job, sign, notarize and re-upload it, uploading it also on s3 download servers for the autoupdate. notarize-macos: @@ -262,10 +262,10 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: ArduinoCreateAgent.app_${{ matrix.arch }} + name: ArduinoCloudAgent.app_${{ matrix.arch }} - name: un-Tar bundle - run: tar -xvf ArduinoCreateAgent.app_${{ matrix.arch }}.tar + run: tar -xvf ArduinoCloudAgent.app_${{ matrix.arch }}.tar - name: Import Code-Signing Certificates run: | @@ -305,7 +305,7 @@ jobs: run: | cat > "${{ env.GON_CONFIG_PATH }}" < /tmp/license.xml @@ -444,14 +445,14 @@ jobs: run: ${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.installbuilder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} architecture=${{ matrix.arch }} - name: Generate archive - run: tar -czvf ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer${{matrix.installer-extension}} + run: tar -czvf ArduinoCloudAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer.tar.gz ArduinoCloudAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer${{matrix.installer-extension}} if: matrix.os == 'ubuntu-20.04' - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: ArduinoCreateAgent-${{ matrix.platform-name }}-${{ matrix.arch }} - path: ArduinoCreateAgent* + name: ArduinoCloudAgent-${{ matrix.platform-name }}-${{ matrix.arch }} + path: ArduinoCloudAgent* if-no-files-found: error # This job will sign the Windows installer @@ -477,7 +478,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: ArduinoCreateAgent-windows-${{ matrix.arch }} + name: ArduinoCloudAgent-windows-${{ matrix.arch }} - name: Save Win signing certificate to file run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}} @@ -488,18 +489,18 @@ jobs: CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }} # https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken run: | - "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Create Agent" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "ArduinoCreateAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe" + "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Cloud Agent" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "ArduinoCloudAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe" - name: Upload artifacts uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ArduinoCreateAgent-windows-${{ matrix.arch }}-signed - path: ArduinoCreateAgent-*-windows-${{ matrix.arch }}-installer.exe + name: ArduinoCloudAgent-windows-${{ matrix.arch }}-signed + path: ArduinoCloudAgent-*-windows-${{ matrix.arch }}-installer.exe # This step is needed because the self hosted runner does not delete files automatically - name: Clean up EXE - run: rm ArduinoCreateAgent-*-windows-${{ matrix.arch }}-installer.exe + run: rm ArduinoCloudAgent-*-windows-${{ matrix.arch }}-installer.exe # This job will generate a dmg mac installer, sign/notarize it. generate-sign-dmg: @@ -519,11 +520,11 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: ArduinoCreateAgent.app_${{ matrix.arch }}_notarized - path: ArduinoCreateAgent.app + name: ArduinoCloudAgent.app_${{ matrix.arch }}_notarized + path: ArduinoCloudAgent.app - name: unzip artifact - working-directory: ArduinoCreateAgent.app + working-directory: ArduinoCloudAgent.app run: | unzip ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip rm ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip @@ -531,18 +532,18 @@ jobs: - name: Install create-dmg run: brew install create-dmg - - name: Genarate DMG + - name: Generate DMG run: | create-dmg \ - --volname "ArduinoCreateAgent" \ + --volname "ArduinoCloudAgent" \ --background "installer_icons/background.tiff" \ --window-pos 200 120 \ --window-size 500 320 \ --icon-size 80 \ - --icon "ArduinoCreateAgent.app" 125 150 \ + --icon "ArduinoCloudAgent.app" 125 150 \ --app-drop-link 375 150 \ - "ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg" \ - "ArduinoCreateAgent.app" + "ArduinoCloudAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg" \ + "ArduinoCloudAgent.app" - name: Import Code-Signing Certificates run: | @@ -572,7 +573,7 @@ jobs: # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) run: | cat > gon.config_installer.hcl <| +------------>| | -| | | | | Arduino Create Agent | | Arduino Board | +| | | | | Arduino Cloud Agent | | Arduino Board | | | Arduino Create Web Editor | +--------------->| |<------------+ | | | | | REST API +----------------------+ serial +---------------+ | +---------------------------+ | @@ -74,7 +74,7 @@ By signing off your commits, you agree to the following agreement, also known as ## Authors and acknowledgment -arduino-create-agent is a fork of @[johnlauer](https://github.com/johnlauer)'s [serial-port-json-server](https://github.com/johnlauer/serial-port-json-server) (which we really want to thank for his kindness and great work) +arduino-cloud-agent is a fork of @[johnlauer](https://github.com/johnlauer)'s [serial-port-json-server](https://github.com/johnlauer/serial-port-json-server) (which we really want to thank for his kindness and great work) The history has been rewritten to keep the repo small (thus removing all binaries committed in the past) diff --git a/Taskfile.yml b/Taskfile.yml index 603a2ce91..b64b12bb5 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -37,7 +37,7 @@ tasks: cmds: - task: go:build vars: - PROJECT_NAME: arduino-create-agent_cli + PROJECT_NAME: arduino-cloud-agent_cli ADDITIONAL_FLAGS: -tags cli go:build-win: @@ -46,7 +46,7 @@ tasks: - rsrc -arch {{.GOARCH}} -manifest manifest.xml # GOARCH shoud be either amd64 or 386 - task: go:build vars: - PROJECT_NAME: arduino-create-agent.exe + PROJECT_NAME: arduino-cloud-agent.exe WIN_FLAGS: -H=windowsgui - rm *.syso # rm file to avoid compilation problems on other platforms vars: @@ -58,7 +58,7 @@ tasks: cmds: - task: go:build vars: - PROJECT_NAME: arduino-create-agent_cli.exe + PROJECT_NAME: arduino-cloud-agent_cli.exe ADDITIONAL_FLAGS: -tags cli # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-go-task/Taskfile.yml @@ -140,7 +140,7 @@ tasks: vars: # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml - PROJECT_NAME: arduino-create-agent + PROJECT_NAME: arduino-cloud-agent # build vars COMMIT: sh: echo "$(git log --no-show-signature -n 1 --format=%h)" diff --git a/home.html b/home.html index e66b7c975..ee523981a 100644 --- a/home.html +++ b/home.html @@ -1,321 +1,346 @@ - - - Arduino Create Agent Debug Console - - - + + Arduino Cloud Agent Debug Console + + + - - + - +
-
-

-            

-        
- - - - \ No newline at end of file + + diff --git a/tests/conftest.py b/tests/conftest.py index 622965b64..0e81d76f0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -27,9 +27,9 @@ @pytest.fixture(scope="function") def agent(pytestconfig): if platform.system() == "Windows": - agent = str(Path(pytestconfig.rootdir) / "arduino-create-agent_cli.exe") + agent = str(Path(pytestconfig.rootdir) / "arduino-cloud-agent_cli.exe") else: - agent = str(Path(pytestconfig.rootdir) / "arduino-create-agent") + agent = str(Path(pytestconfig.rootdir) / "arduino-cloud-agent") env = { # "ARDUINO_DATA_DIR": data_dir, # "ARDUINO_DOWNLOADS_DIR": downloads_dir, diff --git a/updater/updater_darwin.go b/updater/updater_darwin.go index 105a529ef..c4eb5070d 100644 --- a/updater/updater_darwin.go +++ b/updater/updater_darwin.go @@ -143,7 +143,9 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s // Install new app logrus.WithField("from", tmpAppPath).WithField("to", currentAppPath).Info("Copying updated app") - if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || !paths.New(executablePath).Exist() { + createPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Create_Agent") + cloudPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Cloud_Agent") + if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || (!createPath.Exist() && !cloudPath.Exist()) { // Try rollback changes _ = currentAppPath.RemoveAll() _ = oldAppPath.Rename(currentAppPath)