From 19df9226f35ebe90407da3667a35c4a7ea69d31d Mon Sep 17 00:00:00 2001 From: Maurizio Branca Date: Fri, 6 Nov 2020 17:48:40 +0100 Subject: [PATCH 01/14] Update release.yml --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 131a7d4c8..ee3e9a0d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -85,6 +85,8 @@ jobs: CREATE_OSX_BUNDLED_MG: 1 INSTALLER_CERT_WINDOWS_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }} INSTALLER_CERT_WINDOWS_PFX: "/tmp/ArduinoCerts2020.pfx" + INSTALLER_CERT_MAC_PASSWORD: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} + INSTALLER_CERT_MAC_P12: "/tmp/ArduinoCerts2020.p12" strategy: fail-fast: false # if one os is failing continue nonetheless @@ -146,6 +148,33 @@ jobs: run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_PFX }}" | base64 --decode > /tmp/ArduinoCerts2020.pfx if: matrix.operating-system == 'windows-latest' + - name: Import Code-Signing Certificates + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.INSTALLER_CERT_MAC_P12 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} + if: matrix.operating-system == 'macOS-latest' + + - name: Install gon via HomeBrew for code signing and app notarization + run: | + brew tap mitchellh/gon + brew install mitchellh/gon/gon + if: matrix.operating-system == 'macOS-latest' + + - name: Code sign and notarize app + run: | + # copy executable into the 'notatization area' + cp skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge /tmp/Arduino_Create_Bridge + gon gon.config.hcl -log-level=debug -log-json ./gon.json + # copy the notirized executable back into the app bundle + cp /tmp/Arduino_Create_Bridge skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge + if: matrix.operating-system == 'macOS-latest' + env: + AC_USERNAME: ${{ secrets.AC_USERNAME }} + AC_PASSWORD: ${{ secrets.AC_PASSWORD }} + # win(edge),mac(safari) -> CERT_INSTALL and win,mac:(ff,chrome) -> CHOICE_CERT_INSTALL - name: Launch Bitrock installbuilder-20 with CERT_INSTALL && CHOICE_CERT_INSTALL run: | From 5050b9b08b73f1686aea65fee08375d362e447cb Mon Sep 17 00:00:00 2001 From: Maurizio Branca Date: Fri, 6 Nov 2020 17:51:14 +0100 Subject: [PATCH 02/14] Enable workflow on dev branch --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee3e9a0d6..ab255e92b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - umbynos/* + - zmoog/notarize jobs: From 30c8169827fc67327399d42f60bedda98f53705d Mon Sep 17 00:00:00 2001 From: Maurizio Branca Date: Fri, 6 Nov 2020 18:23:41 +0100 Subject: [PATCH 03/14] Move notarization in its own job --- .github/workflows/release.yml | 66 +++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab255e92b..b2e1b8d8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,8 @@ jobs: build: strategy: matrix: - operating-system: [ubuntu-latest, windows-latest, macOS-latest] + # operating-system: [ubuntu-latest, windows-latest, macOS-latest] + operating-system: [macOS-latest] runs-on: ${{ matrix.operating-system }} @@ -74,8 +75,69 @@ jobs: config.ini if-no-files-found: error - package: + + code-sign: needs: build + runs-on: macOS-latest + env: + INSTALLER_CERT_MAC_PASSWORD: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} + INSTALLER_CERT_MAC_P12: "/tmp/ArduinoCerts2020.p12" + + steps: + + - name: Checkout + uses: actions/checkout@v2 + with: + repository: 'bcmi-labs/arduino-create-agent-installer' + token: ${{ secrets.PAT_TEMP }} # use token organization instead + + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: arduino-create-agent-macOS-latest + path: arduino-create-agent-macOS-latest + +# - name: Make executable +# run: chmod +x ${{ matrix.executable-path }}arduino-create-agent* + +# - name: Rename executable to Arduino_Create_Bridge +# run: mv skel/ArduinoCreateAgent.app/Contents/MacOS/arduino-create-agent skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge + + - name: Import Code-Signing Certificates + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.INSTALLER_CERT_MAC_P12 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} +# if: matrix.operating-system == 'macOS-latest' + + - name: Install gon via HomeBrew for code signing and app notarization + run: | + brew tap mitchellh/gon + brew install mitchellh/gon/gon +# if: matrix.operating-system == 'macOS-latest' + + - name: Code sign and notarize app + run: | + # copy executable into the 'notatization area' + # cp skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge /tmp/Arduino_Create_Bridge + gon gon.config.hcl -log-level=debug -log-json ./gon.json + # copy the notirized executable back into the app bundle + # cp /tmp/Arduino_Create_Bridge skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge + env: + AC_USERNAME: ${{ secrets.AC_USERNAME }} + AC_PASSWORD: ${{ secrets.AC_PASSWORD }} + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: arduino-create-agent-macOS-latest + path: arduino-create-agent-macOS-latest + if-no-files-found: error + + package: + needs: code-sign runs-on: ubuntu-latest env: From ab775ec43fc56802524d147bdc982d9379577c7f Mon Sep 17 00:00:00 2001 From: Maurizio Branca Date: Fri, 6 Nov 2020 18:39:47 +0100 Subject: [PATCH 04/14] Fix idiotic mistake --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2e1b8d8f..bfe9f778a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -122,7 +122,7 @@ jobs: run: | # copy executable into the 'notatization area' # cp skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge /tmp/Arduino_Create_Bridge - gon gon.config.hcl -log-level=debug -log-json ./gon.json + gon -log-level=debug -log-json gon.config.hcl # copy the notirized executable back into the app bundle # cp /tmp/Arduino_Create_Bridge skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge env: From 733b58adf001dd84fd07074effccb8997d172dc1 Mon Sep 17 00:00:00 2001 From: Maurizio Branca Date: Fri, 6 Nov 2020 18:50:19 +0100 Subject: [PATCH 05/14] Cleanup --- .github/workflows/release.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfe9f778a..78bcd904d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -211,33 +211,6 @@ jobs: run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_PFX }}" | base64 --decode > /tmp/ArduinoCerts2020.pfx if: matrix.operating-system == 'windows-latest' - - name: Import Code-Signing Certificates - uses: Apple-Actions/import-codesign-certs@v1 - with: - # The certificates in a PKCS12 file encoded as a base64 string - p12-file-base64: ${{ secrets.INSTALLER_CERT_MAC_P12 }} - # The password used to import the PKCS12 file. - p12-password: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} - if: matrix.operating-system == 'macOS-latest' - - - name: Install gon via HomeBrew for code signing and app notarization - run: | - brew tap mitchellh/gon - brew install mitchellh/gon/gon - if: matrix.operating-system == 'macOS-latest' - - - name: Code sign and notarize app - run: | - # copy executable into the 'notatization area' - cp skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge /tmp/Arduino_Create_Bridge - gon gon.config.hcl -log-level=debug -log-json ./gon.json - # copy the notirized executable back into the app bundle - cp /tmp/Arduino_Create_Bridge skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge - if: matrix.operating-system == 'macOS-latest' - env: - AC_USERNAME: ${{ secrets.AC_USERNAME }} - AC_PASSWORD: ${{ secrets.AC_PASSWORD }} - # win(edge),mac(safari) -> CERT_INSTALL and win,mac:(ff,chrome) -> CHOICE_CERT_INSTALL - name: Launch Bitrock installbuilder-20 with CERT_INSTALL && CHOICE_CERT_INSTALL run: | From 191e36549263db620f67f65fd86f22349f4eb7a9 Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 9 Nov 2020 12:01:32 +0100 Subject: [PATCH 06/14] cleanup && fix installer generation not finding p12 cert --- .github/workflows/release.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78bcd904d..d71d67c32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,6 @@ jobs: INSTALLER_CERT_MAC_P12: "/tmp/ArduinoCerts2020.p12" steps: - - name: Checkout uses: actions/checkout@v2 with: @@ -97,12 +96,6 @@ jobs: name: arduino-create-agent-macOS-latest path: arduino-create-agent-macOS-latest -# - name: Make executable -# run: chmod +x ${{ matrix.executable-path }}arduino-create-agent* - -# - name: Rename executable to Arduino_Create_Bridge -# run: mv skel/ArduinoCreateAgent.app/Contents/MacOS/arduino-create-agent skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge - - name: Import Code-Signing Certificates uses: Apple-Actions/import-codesign-certs@v1 with: @@ -110,21 +103,17 @@ jobs: p12-file-base64: ${{ secrets.INSTALLER_CERT_MAC_P12 }} # The password used to import the PKCS12 file. p12-password: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} -# if: matrix.operating-system == 'macOS-latest' - name: Install gon via HomeBrew for code signing and app notarization run: | brew tap mitchellh/gon brew install mitchellh/gon/gon -# if: matrix.operating-system == 'macOS-latest' - name: Code sign and notarize app run: | - # copy executable into the 'notatization area' - # cp skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge /tmp/Arduino_Create_Bridge - gon -log-level=debug -log-json gon.config.hcl - # copy the notirized executable back into the app bundle - # cp /tmp/Arduino_Create_Bridge skel/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge + gon -log-level=debug -log-json gon.config.hcl + # gon will notarize ezecutable in "arduino-create-agent-macOS-latest/arduino-create-agent + # The CI will ignore the zip output, using the signed binary only. env: AC_USERNAME: ${{ secrets.AC_USERNAME }} AC_PASSWORD: ${{ secrets.AC_PASSWORD }} @@ -211,6 +200,10 @@ jobs: run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_PFX }}" | base64 --decode > /tmp/ArduinoCerts2020.pfx if: matrix.operating-system == 'windows-latest' + - name: Save macOS signing certificate to file + run: echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > /tmp/ArduinoCerts2020.p12 + if: matrix.operating-system == 'macOS-latest' + # win(edge),mac(safari) -> CERT_INSTALL and win,mac:(ff,chrome) -> CHOICE_CERT_INSTALL - name: Launch Bitrock installbuilder-20 with CERT_INSTALL && CHOICE_CERT_INSTALL run: | From 7e90ea7276f957cc74c1fe2377600b28524a69dc Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 9 Nov 2020 12:16:52 +0100 Subject: [PATCH 07/14] fix typo --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d71d67c32..789fd8e9d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,7 +147,7 @@ jobs: include: - operating-system: ubuntu-latest - bowser: '' + browser: '' install-builder-name: linux-x64 executable-path: artifacts/linux-amd64/ extension: '' @@ -159,7 +159,7 @@ jobs: extension: .exe installer-extension: .exe - operating-system: macOS-latest - bowser: safari + browser: safari install-builder-name: osx executable-path: 'skel/ArduinoCreateAgent.app/Contents/MacOS/' extension: '' From 5598271a00b64ad0eb4c01efc8e5eb8293561aa5 Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 9 Nov 2020 16:22:15 +0100 Subject: [PATCH 08/14] add notarization of the installer && cleanup --- .github/workflows/release.yml | 134 +++++++++++++++------------------- 1 file changed, 59 insertions(+), 75 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 789fd8e9d..7ea54b563 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,8 +11,7 @@ jobs: build: strategy: matrix: - # operating-system: [ubuntu-latest, windows-latest, macOS-latest] - operating-system: [macOS-latest] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] runs-on: ${{ matrix.operating-system }} @@ -29,7 +28,6 @@ jobs: go-version: "1.15" - name: Install Dependencies (Linux) - # run: sudo apt-get install ninja-build run: sudo apt update && sudo apt install -y --no-install-recommends build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev if: matrix.operating-system == 'ubuntu-latest' @@ -76,7 +74,7 @@ jobs: if-no-files-found: error - code-sign: + code-sign-mac-executable: needs: build runs-on: macOS-latest env: @@ -126,7 +124,7 @@ jobs: if-no-files-found: error package: - needs: code-sign + needs: code-sign-mac-executable runs-on: ubuntu-latest env: @@ -134,7 +132,7 @@ jobs: CERT_INSTALL: "ask_certificates_install=CI" # win(edge),mac(safari) NO_CERT_INSTALL: "ask_certificates_install=CS" # linux CHOICE_CERT_INSTALL: "ask_certificates_install=CC" # win,mac:(ff,chrome) - CREATE_OSX_BUNDLED_MG: 1 + CREATE_OSX_BUNDLED_MG: 0 # do not create the DMG, gon will take care of that INSTALLER_CERT_WINDOWS_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }} INSTALLER_CERT_WINDOWS_PFX: "/tmp/ArduinoCerts2020.pfx" INSTALLER_CERT_MAC_PASSWORD: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} @@ -147,11 +145,8 @@ jobs: include: - operating-system: ubuntu-latest - browser: '' install-builder-name: linux-x64 executable-path: artifacts/linux-amd64/ - extension: '' - installer-extension: '' - operating-system: windows-latest browser: edge install-builder-name: windows @@ -162,8 +157,7 @@ jobs: browser: safari install-builder-name: osx executable-path: 'skel/ArduinoCreateAgent.app/Contents/MacOS/' - extension: '' - installer-extension: .dmg + installer-extension: .app container: image: floydpink/ubuntu-install-builder:latest @@ -205,6 +199,7 @@ jobs: if: matrix.operating-system == 'macOS-latest' # win(edge),mac(safari) -> CERT_INSTALL and win,mac:(ff,chrome) -> CHOICE_CERT_INSTALL + # installbuilder reads the env vars with certs paths and use it to sign the installer. - name: Launch Bitrock installbuilder-20 with CERT_INSTALL && CHOICE_CERT_INSTALL run: | /opt/installbuilder-20.3.0/bin/builder build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.CERT_INSTALL }} @@ -232,67 +227,56 @@ jobs: path: ArduinoCreateAgent* if-no-files-found: error - # - name: Send unit tests coverage to Codecov - # if: > - # matrix.operating-system == 'ubuntu-latest' && - # github.event_name == 'push' - # uses: codecov/codecov-action@v1 - # with: - # file: ./coverage_unit.txt - # flags: unit - - # - name: Send legacy tests coverage to Codecov - # if: > - # matrix.operating-system == 'ubuntu-latest' && - # github.event_name == 'push' - # uses: codecov/codecov-action@v1 - # with: - # file: ./coverage_legacy.txt - # flags: unit - - # - name: Send integration tests coverage to Codecov - # if: > - # matrix.operating-system == 'ubuntu-latest' && - # github.event_name == 'push' - # uses: codecov/codecov-action@v1 - # with: - # file: ./coverage_integ.txt - # flags: integ - - # package-macOS: - # needs: build - # strategy: - # matrix: - # # operating-system: [windows-latest, macOS-latest] - # operating-system: [macOS-latest] - - # runs-on: ${{ matrix.operating-system }} - - # steps: - # # - name: Disable EOL conversions - # # run: git config --global core.autocrlf false - - # - name: Checkout - # uses: actions/checkout@v2 - - # - name: Download artifacts - # uses: actions/download-artifact@v2 - # with: - # name: arduino-create-agent-${{ matrix.operating-system }} - # path: arduino-create-agent - - # - name: Build .app - # run: | - # mkdir build - # cp -r skel/ build - # cp arduino-create-agent/arduino-create-agent build/ArduinoCreateAgent.app/Contents/MacOS/Arduino_Create_Bridge - # cp config.ini build/ArduinoCreateAgent.app/Contents/MacOS/ - - # find build - # shell: bash - - # - name: Download Gon - # run: | - # wget -q https://github.com/mitchellh/gon/releases/download/v0.2.2/gon_0.2.2_macos.zip - # unzip gon_0.2.2_macos.zip -d /usr/local/bin - # rm -f gon_0.2.2_macos.zip + code-sign-mac-installers: + needs: package + runs-on: macOS-latest + env: + INSTALLER_CERT_MAC_PASSWORD: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} + INSTALLER_CERT_MAC_P12: "/tmp/ArduinoCerts2020.p12" + + strategy: + matrix: + browser: [safari, firefox, chrome] + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + repository: 'bcmi-labs/arduino-create-agent-installer' + token: ${{ secrets.PAT_TEMP }} # use token organization instead + ref: 'umbynos/gon_installer' # TODO: only for test + + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ArduinoCreateAgent-osx + path: $PWD + + - name: Import Code-Signing Certificates + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.INSTALLER_CERT_MAC_P12 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }} + + - name: Install gon via HomeBrew for code signing and app notarization + run: | + brew tap mitchellh/gon + brew install mitchellh/gon/gon + + - name: Code sign and notarize app + run: | + echo "gon will notarize executable ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${BROWSER}.app" + gon -log-level=debug -log-json gon.config_installer.hcl + env: + AC_USERNAME: ${{ secrets.AC_USERNAME }} + AC_PASSWORD: ${{ secrets.AC_PASSWORD }} + BROWSER: ${{ matrix.browser }} + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ArduinoCreateAgent-osx + path: ArduinoCreateAgent*.dmg + if-no-files-found: error \ No newline at end of file From b090f1832da5d70b856b75ccbd0ca0a52f9e6b39 Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 9 Nov 2020 16:41:44 +0100 Subject: [PATCH 09/14] fix stupid error --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ea54b563..44eb6a5d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -205,7 +205,7 @@ jobs: /opt/installbuilder-20.3.0/bin/builder build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.CERT_INSTALL }} mv ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CI${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-${{matrix.browser}}${{matrix.installer-extension}} /opt/installbuilder-20.3.0/bin/builder build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.CHOICE_CERT_INSTALL }} - cp ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome${{matrix.installer-extension}} + cp -r ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome${{matrix.installer-extension}} mv ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox${{matrix.installer-extension}} rm -r ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-C* if: matrix.operating-system == 'windows-latest' || matrix.operating-system == 'macOS-latest' From a16bacdd3295b8eec71a974a296b22e17a7e29a4 Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 9 Nov 2020 18:16:55 +0100 Subject: [PATCH 10/14] gon does not allow env variables in config file --- .github/workflows/release.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44eb6a5d0..0982e1e41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -239,12 +239,6 @@ jobs: browser: [safari, firefox, chrome] steps: - - name: Checkout - uses: actions/checkout@v2 - with: - repository: 'bcmi-labs/arduino-create-agent-installer' - token: ${{ secrets.PAT_TEMP }} # use token organization instead - ref: 'umbynos/gon_installer' # TODO: only for test - name: Download artifacts uses: actions/download-artifact@v2 @@ -265,6 +259,23 @@ jobs: brew tap mitchellh/gon brew install mitchellh/gon/gon + - name: Write gon config to file + # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) + run: | + cat > gon.config_installer.hcl < Date: Mon, 9 Nov 2020 18:39:38 +0100 Subject: [PATCH 11/14] fix gon not finding executable --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0982e1e41..dac5fdd34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -244,7 +244,7 @@ jobs: uses: actions/download-artifact@v2 with: name: ArduinoCreateAgent-osx - path: $PWD + path: ArduinoCreateAgent-osx - name: Import Code-Signing Certificates uses: Apple-Actions/import-codesign-certs@v1 @@ -263,7 +263,7 @@ jobs: # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) run: | cat > gon.config_installer.hcl < Date: Tue, 10 Nov 2020 10:33:30 +0100 Subject: [PATCH 12/14] add verbose to `cp` and `mv` to print on CI logs --- .github/workflows/release.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dac5fdd34..67af9fbf2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -181,10 +181,10 @@ jobs: if: matrix.operating-system == 'ubuntu-latest' || matrix.operating-system == 'macOS-latest' - name: Rename executable to Arduino_Create_Bridge - run: mv ${{ matrix.executable-path }}arduino-create-agent${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Bridge${{ matrix.extension }} + run: mv -v ${{ matrix.executable-path }}arduino-create-agent${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Bridge${{ matrix.extension }} - name: Rename executable to Arduino_Create_Bridge_cli - run: mv ${{ matrix.executable-path }}arduino-create-agent_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Bridge_cli${{ matrix.extension }} + run: mv -v ${{ matrix.executable-path }}arduino-create-agent_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Bridge_cli${{ matrix.extension }} if: matrix.operating-system == 'ubuntu-latest' - name: Save InstallBuilder license to file @@ -203,10 +203,10 @@ jobs: - name: Launch Bitrock installbuilder-20 with CERT_INSTALL && CHOICE_CERT_INSTALL run: | /opt/installbuilder-20.3.0/bin/builder build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.CERT_INSTALL }} - mv ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CI${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-${{matrix.browser}}${{matrix.installer-extension}} + mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CI${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-${{matrix.browser}}${{matrix.installer-extension}} /opt/installbuilder-20.3.0/bin/builder build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.CHOICE_CERT_INSTALL }} - cp -r ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome${{matrix.installer-extension}} - mv ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox${{matrix.installer-extension}} + cp -vr ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome${{matrix.installer-extension}} + mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox${{matrix.installer-extension}} rm -r ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-C* if: matrix.operating-system == 'windows-latest' || matrix.operating-system == 'macOS-latest' @@ -214,10 +214,10 @@ jobs: - name: Launch Bitrock installbuilder-20 with NO_CERT_INSTALL run: | /opt/installbuilder-20.3.0/bin/builder build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.NO_CERT_INSTALL }} - cp ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome.run - mv ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox.run - cp ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome.tar.gz - mv ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox.tar.gz + cp -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome.run + mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox.run + cp -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome.tar.gz + mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox.tar.gz if: matrix.operating-system == 'ubuntu-latest' - name: Upload artifacts From 3cfa30167ccd839a3a47e9ce775ad5d3078a2e95 Mon Sep 17 00:00:00 2001 From: umbynos Date: Tue, 10 Nov 2020 10:52:04 +0100 Subject: [PATCH 13/14] fix permissions not being kept on macos --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67af9fbf2..60e9637fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -246,6 +246,9 @@ jobs: name: ArduinoCreateAgent-osx path: ArduinoCreateAgent-osx + - name: Make executable + run: chmod +x ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.app/Contents/MacOS/* + - name: Import Code-Signing Certificates uses: Apple-Actions/import-codesign-certs@v1 with: @@ -284,9 +287,12 @@ jobs: AC_USERNAME: ${{ secrets.AC_USERNAME }} AC_PASSWORD: ${{ secrets.AC_PASSWORD }} + - name: Tar files to keep permissions + run: tar -cvf ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.tar ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.dmg + - name: Upload artifacts uses: actions/upload-artifact@v2 with: name: ArduinoCreateAgent-osx - path: ArduinoCreateAgent*.dmg + path: ArduinoCreateAgent*.tar if-no-files-found: error From 5ac0334476d47b208b0777adb67a5f516f79d558 Mon Sep 17 00:00:00 2001 From: umbynos Date: Tue, 10 Nov 2020 12:00:58 +0100 Subject: [PATCH 14/14] add verbose to `chmod` --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60e9637fd..a5f63f8bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -177,7 +177,7 @@ jobs: path: ${{ matrix.executable-path }} - name: Make executable - run: chmod +x ${{ matrix.executable-path }}arduino-create-agent* + run: chmod -v +x ${{ matrix.executable-path }}arduino-create-agent* if: matrix.operating-system == 'ubuntu-latest' || matrix.operating-system == 'macOS-latest' - name: Rename executable to Arduino_Create_Bridge @@ -247,7 +247,7 @@ jobs: path: ArduinoCreateAgent-osx - name: Make executable - run: chmod +x ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.app/Contents/MacOS/* + run: chmod -v +x ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.app/Contents/MacOS/* - name: Import Code-Signing Certificates uses: Apple-Actions/import-codesign-certs@v1