From e53c72026e3151ce31b9c50ab76ab66382b011d2 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 11:36:16 +0200 Subject: [PATCH 01/14] try composite action --- .github/actions/0_setup/action.yml | 22 ++++++++++++++++++++++ .github/workflows/BuildMeshLab.yml | 12 +++++------- 2 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 .github/actions/0_setup/action.yml diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml new file mode 100644 index 000000000..9dcd139fb --- /dev/null +++ b/.github/actions/0_setup/action.yml @@ -0,0 +1,22 @@ +name: 'Setup Environment' +description: 'Setup Environment' + +inputs: + mac-certificate: + description: 'MacOS Certificate' + required: false + mac-certificate-pssw: + description: 'MacOS Certificate Password' + required: false + +runs: + using: "composite" + steps: + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Set CodeSign Certificate macOS + if: runner.os == 'macOS' && ${{ inputs.mac-certificate }} != null + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ inputs.mac-certificate }} + p12-password: ${{ inputs.mac-certificate-pssw }} diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index 6f9327af4..e84670c65 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -6,6 +6,7 @@ on: env: QT_VERSION: 5.15.2 MAC_CERT: ${{secrets.MACOS_CERT_ID}} + MAC_CERT_PSSW: ${{secrets.MACOS_CERTIFICATE_PSSW}} WIN_CERT: ${{secrets.WIN_CERTIFICATE}} jobs: @@ -21,14 +22,11 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - - name: Set CodeSign Certificate macOS - if: runner.os == 'macOS' && env.MAC_CERT != null - uses: apple-actions/import-codesign-certs@v2 + - name: Setup Environment + uses: ./.github/actions/0_setup with: - p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} - p12-password: ${{ secrets.MACOS_CERTIFICATE_PSSW }} + mac-certificate: $MAC_CERT + mac-certificate-pssw: $MAC_CERT_PSSW - name: Set CodeSign Certificate Windows if: runner.os == 'Windows' && env.WIN_CERT != null run: | From 16d8084ad3a8d14e1cbcf10d6348f9aa1a82dd64 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 11:52:28 +0200 Subject: [PATCH 02/14] try using composite with if --- .github/actions/0_setup/action.yml | 11 +++++------ .github/workflows/BuildMeshLab.yml | 6 ++++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index 9dcd139fb..589e6d977 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -14,9 +14,8 @@ runs: steps: - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - - name: Set CodeSign Certificate macOS - if: runner.os == 'macOS' && ${{ inputs.mac-certificate }} != null - uses: apple-actions/import-codesign-certs@v2 - with: - p12-file-base64: ${{ inputs.mac-certificate }} - p12-password: ${{ inputs.mac-certificate-pssw }} + - name: Try + if: ${{ runner.os }} == 'macOS' + shell: bash + run: | + echo "Hello World ${{ runner.os }}" diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index e84670c65..162e77066 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -27,6 +27,12 @@ jobs: with: mac-certificate: $MAC_CERT mac-certificate-pssw: $MAC_CERT_PSSW + - name: Set CodeSign Certificate macOS + if: runner.os == 'macOS' && env.MAC_CERT != null + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} + p12-password: ${{ secrets.MACOS_CERTIFICATE_PSSW }} - name: Set CodeSign Certificate Windows if: runner.os == 'Windows' && env.WIN_CERT != null run: | From 2cbe1da0ba5c89b37b6273caef22dff856d176d3 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 11:55:16 +0200 Subject: [PATCH 03/14] test always false condition --- .github/actions/0_setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index 589e6d977..cf793e73a 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -15,7 +15,7 @@ runs: - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Try - if: ${{ runner.os }} == 'macOS' + if: 'Windows' == 'macOS' shell: bash run: | echo "Hello World ${{ runner.os }}" From e22e5180be599a72b24146c115b73a4101396f1d Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 12:02:17 +0200 Subject: [PATCH 04/14] pass runner as input --- .github/actions/0_setup/action.yml | 7 +++++-- .github/workflows/BuildMeshLab.yml | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index cf793e73a..fe530f367 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -2,6 +2,9 @@ name: 'Setup Environment' description: 'Setup Environment' inputs: + runner-os: + description: 'Runner OS' + required: true mac-certificate: description: 'MacOS Certificate' required: false @@ -15,7 +18,7 @@ runs: - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Try - if: 'Windows' == 'macOS' + if: ${{ inputs.runner-os }} == 'macOS' shell: bash run: | - echo "Hello World ${{ runner.os }}" + echo "Hello World ${{ inputs.runner-os }}" diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index 162e77066..8a6280ff0 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -25,6 +25,7 @@ jobs: - name: Setup Environment uses: ./.github/actions/0_setup with: + runner-os: ${{ runner.os }} mac-certificate: $MAC_CERT mac-certificate-pssw: $MAC_CERT_PSSW - name: Set CodeSign Certificate macOS From f56fb04d427e26665bd54e7350c85d89bf28ceba Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 12:11:43 +0200 Subject: [PATCH 05/14] try different check --- .github/actions/0_setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index fe530f367..5a9f6be81 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -18,7 +18,7 @@ runs: - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Try - if: ${{ inputs.runner-os }} == 'macOS' + if: ${{ inputs.runner-os == 'macOS' }} shell: bash run: | echo "Hello World ${{ inputs.runner-os }}" From 96c778446e88aa0c0e0c658771c1ebd80b71488a Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 12:13:30 +0200 Subject: [PATCH 06/14] not passing runner os as input --- .github/actions/0_setup/action.yml | 5 +---- .github/workflows/BuildMeshLab.yml | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index 5a9f6be81..c999b7d76 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -2,9 +2,6 @@ name: 'Setup Environment' description: 'Setup Environment' inputs: - runner-os: - description: 'Runner OS' - required: true mac-certificate: description: 'MacOS Certificate' required: false @@ -18,7 +15,7 @@ runs: - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Try - if: ${{ inputs.runner-os == 'macOS' }} + if: ${{ runner.os == 'macOS' }} shell: bash run: | echo "Hello World ${{ inputs.runner-os }}" diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index 8a6280ff0..162e77066 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -25,7 +25,6 @@ jobs: - name: Setup Environment uses: ./.github/actions/0_setup with: - runner-os: ${{ runner.os }} mac-certificate: $MAC_CERT mac-certificate-pssw: $MAC_CERT_PSSW - name: Set CodeSign Certificate macOS From 723e39cdf353bd1f067a998293eda13bc9fbdb87 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 12:17:24 +0200 Subject: [PATCH 07/14] sign on composite action --- .github/actions/0_setup/action.yml | 12 +++++++----- .github/workflows/BuildMeshLab.yml | 6 ------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index c999b7d76..a0e8c13fa 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -5,6 +5,7 @@ inputs: mac-certificate: description: 'MacOS Certificate' required: false + default: '' mac-certificate-pssw: description: 'MacOS Certificate Password' required: false @@ -14,8 +15,9 @@ runs: steps: - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - - name: Try - if: ${{ runner.os == 'macOS' }} - shell: bash - run: | - echo "Hello World ${{ inputs.runner-os }}" + - name: Set CodeSign Certificate macOS + if: ${{ runner.os == 'macOS' && inputs.mac-certificate != ''}} + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ inputs.mac-certificate }} + p12-password: ${{ inputs.mac-certificate-pssw }} diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index 162e77066..e84670c65 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -27,12 +27,6 @@ jobs: with: mac-certificate: $MAC_CERT mac-certificate-pssw: $MAC_CERT_PSSW - - name: Set CodeSign Certificate macOS - if: runner.os == 'macOS' && env.MAC_CERT != null - uses: apple-actions/import-codesign-certs@v2 - with: - p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} - p12-password: ${{ secrets.MACOS_CERTIFICATE_PSSW }} - name: Set CodeSign Certificate Windows if: runner.os == 'Windows' && env.WIN_CERT != null run: | From 42cafd353c7c55c82409ceb178f4dbb2df298616 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 12:21:38 +0200 Subject: [PATCH 08/14] fix mac certificate --- .github/workflows/BuildMeshLab.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index e84670c65..e25291df9 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -25,8 +25,8 @@ jobs: - name: Setup Environment uses: ./.github/actions/0_setup with: - mac-certificate: $MAC_CERT - mac-certificate-pssw: $MAC_CERT_PSSW + mac-certificate: ${{ secrets.MACOS_CERTIFICATE }} + mac-certificate-pssw: ${{ secrets.MACOS_CERTIFICATE_PSSW }} - name: Set CodeSign Certificate Windows if: runner.os == 'Windows' && env.WIN_CERT != null run: | From 9cb8fa34b1dd303f928bf6448b37662ec1f74173 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 12:29:16 +0200 Subject: [PATCH 09/14] move win certificate on composite action --- .github/actions/0_setup/action.yml | 19 +++++++++++++++++++ .github/workflows/BuildMeshLab.yml | 12 +----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index a0e8c13fa..fcef22fdc 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -9,6 +9,14 @@ inputs: mac-certificate-pssw: description: 'MacOS Certificate Password' required: false + win-certificate: + description: 'Windows Certificate' + required: false + default: '' + qt-version: + description: 'Qt Version' + required: false + default: '5.15.2' runs: using: "composite" @@ -21,3 +29,14 @@ runs: with: p12-file-base64: ${{ inputs.mac-certificate }} p12-password: ${{ inputs.mac-certificate-pssw }} + - name: Set CodeSign Certificate Windows + if: ${{ runner.os == 'Windows' && inputs.win-certificate != '' }} + run: | + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ inputs.win-certificate }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + cache: true + version: ${{ inputs.qt-version }} diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index e25291df9..17ee9f5ee 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -27,17 +27,7 @@ jobs: with: mac-certificate: ${{ secrets.MACOS_CERTIFICATE }} mac-certificate-pssw: ${{ secrets.MACOS_CERTIFICATE_PSSW }} - - name: Set CodeSign Certificate Windows - if: runner.os == 'Windows' && env.WIN_CERT != null - run: | - New-Item -ItemType directory -Path certificate - Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_CERTIFICATE }}' - certutil -decode certificate\certificate.txt certificate\certificate.pfx - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - cache: true - version: ${{ env.QT_VERSION }} + win-certificate: ${{ secrets.WIN_CERTIFICATE }} - name: Install dependencies shell: bash run: | From 65262978ac001a268136ad8cb4fb39e111559551 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 12:31:13 +0200 Subject: [PATCH 10/14] missing powershell --- .github/actions/0_setup/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index fcef22fdc..a010b8719 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -30,6 +30,7 @@ runs: p12-file-base64: ${{ inputs.mac-certificate }} p12-password: ${{ inputs.mac-certificate-pssw }} - name: Set CodeSign Certificate Windows + shell: powershell if: ${{ runner.os == 'Windows' && inputs.win-certificate != '' }} run: | New-Item -ItemType directory -Path certificate From f33415303d4c0e04a5a1d877751a88c61d88ca3f Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 14:02:08 +0200 Subject: [PATCH 11/14] build in a composite action --- .github/actions/0_setup/action.yml | 4 +++ .github/actions/1_build/action.yml | 56 ++++++++++++++++++++++++++++++ .github/workflows/BuildMeshLab.yml | 23 ++++-------- 3 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 .github/actions/1_build/action.yml diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index a010b8719..d305c6940 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -41,3 +41,7 @@ runs: with: cache: true version: ${{ inputs.qt-version }} + - name: Install dependencies + shell: bash + run: | + bash scripts/${{ runner.os }}/0_setup_env.sh --dont_install_qt \ No newline at end of file diff --git a/.github/actions/1_build/action.yml b/.github/actions/1_build/action.yml new file mode 100644 index 000000000..e0d0f7b0a --- /dev/null +++ b/.github/actions/1_build/action.yml @@ -0,0 +1,56 @@ +name: 'Build' +description: 'Build' + +inputs: + cache-path: + description: 'Directory to cache after build' + required: false + default: '' + cache-key: + description: 'Cache key' + required: false + default: '' + build-option: + description: 'Build option' + required: false + default: '' + nightly: + description: 'Nightly build' + required: false + type: boolean + default: false + +runs: + using: "composite" + steps: + - name: Setup env variables + id: envs + shell: bash + run: | + if [ "${{ inputs.build-option }}" != "" ]; then + echo "build_option=--${{ inputs.build-option }}" >> $GITHUB_OUTPUT + echo "artifact_suffix=_${{ inputs.build-option }}" >> $GITHUB_OUTPUT + else + echo "build_option=" >> $GITHUB_OUTPUT + echo "artifact_suffix=" >> $GITHUB_OUTPUT + fi + if [ "${{ inputs.nightly }}" = "true" ]; then + echo "nightly=--nightly" >> $GITHUB_OUTPUT + else + echo "nightly=" >> $GITHUB_OUTPUT + fi + - name: Cache external libraries sources + id: cache-ext-libs + if: ${{ inputs.cache-path != '' }} + uses: actions/cache@v3 + with: + path: ${{ inputs.cache-path }} + key: ${{ runner.os }}-${{ inputs.cache-key }} + - name: Ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ runner.os }}-${{ github.ref }}-${{ inputs.build-option }} + - name: Configure and Build + shell: bash + run: | + bash scripts/${{ runner.os }}/1_build.sh ${{ steps.envs.outputs.build_option }} ${{ steps.envs.outputs.nightly }} --ccache \ No newline at end of file diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index 17ee9f5ee..d64ec602d 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -28,10 +28,6 @@ jobs: mac-certificate: ${{ secrets.MACOS_CERTIFICATE }} mac-certificate-pssw: ${{ secrets.MACOS_CERTIFICATE_PSSW }} win-certificate: ${{ secrets.WIN_CERTIFICATE }} - - name: Install dependencies - shell: bash - run: | - bash scripts/${{ runner.os }}/0_setup_env.sh --dont_install_qt - name: Setup env variables id: envs shell: bash @@ -41,20 +37,13 @@ jobs: else echo "artifact_suffix=" >> $GITHUB_OUTPUT fi - - name: Cache external libraries sources - id: cache-ext-libs - uses: actions/cache@v3 + - name: Build + uses: ./.github/actions/1_build with: - path: src/external/downloads/* - key: ${{ runner.os }}-external-libraries - - name: Ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ runner.os }}-${{ github.ref }}-${{ matrix.precision }} - - name: Configure and Build - shell: bash - run: | - bash scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }} --nightly --ccache + cache-path: src/external/downloads/* + cache-key: external-libraries + build-option: ${{matrix.precision}} + nightly: true - name: Deploy shell: bash run: | From ab419fa6c2e9b0c1eeb051eda7590084189e186f Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 14:44:26 +0200 Subject: [PATCH 12/14] deploy in a composite action --- .github/actions/0_setup/action.yml | 24 ---------------- .github/actions/2_deploy/action.yml | 44 +++++++++++++++++++++++++++++ .github/workflows/BuildMeshLab.yml | 14 ++++----- 3 files changed, 51 insertions(+), 31 deletions(-) create mode 100644 .github/actions/2_deploy/action.yml diff --git a/.github/actions/0_setup/action.yml b/.github/actions/0_setup/action.yml index d305c6940..24bcf9db8 100644 --- a/.github/actions/0_setup/action.yml +++ b/.github/actions/0_setup/action.yml @@ -2,17 +2,6 @@ name: 'Setup Environment' description: 'Setup Environment' inputs: - mac-certificate: - description: 'MacOS Certificate' - required: false - default: '' - mac-certificate-pssw: - description: 'MacOS Certificate Password' - required: false - win-certificate: - description: 'Windows Certificate' - required: false - default: '' qt-version: description: 'Qt Version' required: false @@ -23,19 +12,6 @@ runs: steps: - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - - name: Set CodeSign Certificate macOS - if: ${{ runner.os == 'macOS' && inputs.mac-certificate != ''}} - uses: apple-actions/import-codesign-certs@v2 - with: - p12-file-base64: ${{ inputs.mac-certificate }} - p12-password: ${{ inputs.mac-certificate-pssw }} - - name: Set CodeSign Certificate Windows - shell: powershell - if: ${{ runner.os == 'Windows' && inputs.win-certificate != '' }} - run: | - New-Item -ItemType directory -Path certificate - Set-Content -Path certificate\certificate.txt -Value '${{ inputs.win-certificate }}' - certutil -decode certificate\certificate.txt certificate\certificate.pfx - name: Install Qt uses: jurplel/install-qt-action@v3 with: diff --git a/.github/actions/2_deploy/action.yml b/.github/actions/2_deploy/action.yml new file mode 100644 index 000000000..cf207d465 --- /dev/null +++ b/.github/actions/2_deploy/action.yml @@ -0,0 +1,44 @@ +name: 'Deploy' +description: 'Deploy' + +inputs: + mac-certificate: + description: 'MacOS Certificate' + required: false + default: '' + mac-certificate-id: + description: 'MacOS Certificate ID' + required: false + default: '' + mac-certificate-pssw: + description: 'MacOS Certificate Password' + required: false + win-certificate: + description: 'Windows Certificate' + required: false + default: '' + win-certificate-pssw: + description: 'Windows Certificate Password' + required: false + default: '' + +runs: + using: "composite" + steps: + - name: Set CodeSign Certificate macOS + if: ${{ runner.os == 'macOS' && inputs.mac-certificate != ''}} + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ inputs.mac-certificate }} + p12-password: ${{ inputs.mac-certificate-pssw }} + - name: Set CodeSign Certificate Windows + shell: powershell + if: ${{ runner.os == 'Windows' && inputs.win-certificate != '' }} + run: | + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ inputs.win-certificate }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + - name: Deploy + shell: bash + run: | + bash scripts/${{ runner.os }}/2_deploy.sh --cert_pssw='${{ inputs.win-certificate-pssw }}' --cert_id='${{ inputs.mac-certificate-id }}' \ No newline at end of file diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index d64ec602d..97333163c 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -24,10 +24,6 @@ jobs: submodules: recursive - name: Setup Environment uses: ./.github/actions/0_setup - with: - mac-certificate: ${{ secrets.MACOS_CERTIFICATE }} - mac-certificate-pssw: ${{ secrets.MACOS_CERTIFICATE_PSSW }} - win-certificate: ${{ secrets.WIN_CERTIFICATE }} - name: Setup env variables id: envs shell: bash @@ -45,9 +41,13 @@ jobs: build-option: ${{matrix.precision}} nightly: true - name: Deploy - shell: bash - run: | - bash scripts/${{ runner.os }}/2_deploy.sh --cert_pssw='${{ secrets.WIN_CERTIFICATE_PSSW }}' --cert_id='${{ secrets.MACOS_CERT_ID }}' + uses: ./.github/actions/2_deploy + with: + mac-certificate: ${{ secrets.MACOS_CERTIFICATE }} + mac-certificate-id: ${{ secrets.MACOS_CERT_ID }} + mac-certificate-pssw: ${{ secrets.MACOS_CERTIFICATE_PSSW }} + win-certificate: ${{ secrets.WIN_CERTIFICATE }} + win-certificate-pssw: ${{ secrets.WIN_CERTIFICATE_PSSW }} - name: Upload MeshLab Portable uses: actions/upload-artifact@v3 with: From 9fda93bb109535a284b33992f18ff6285905fec1 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 15:24:51 +0200 Subject: [PATCH 13/14] using composites on CreateRelease --- .github/actions/2_deploy/action.yml | 23 +++++++++++- .github/workflows/CreateRelease.yml | 58 +++++++++-------------------- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/.github/actions/2_deploy/action.yml b/.github/actions/2_deploy/action.yml index cf207d465..69b582081 100644 --- a/.github/actions/2_deploy/action.yml +++ b/.github/actions/2_deploy/action.yml @@ -13,6 +13,18 @@ inputs: mac-certificate-pssw: description: 'MacOS Certificate Password' required: false + mac-notarization-user: + description: 'MacOS Notarization User' + required: false + default: '' + mac-notarization-team: + description: 'MacOS Notarization Team' + required: false + default: '' + mac-notarization-pssw: + description: 'MacOS Notarization Password' + required: false + default: '' win-certificate: description: 'Windows Certificate' required: false @@ -25,6 +37,15 @@ inputs: runs: using: "composite" steps: + - name: Set Notarization settings + id: notarization + shell: bash + run: | + if [ "${{ inputs.mac-notarization-user }}" != "" ]; then + echo "not_setting=--notarization_user='${{ inputs.mac-notarization-user }}' --notarization_team='${{ inputs.mac-notarization-team }}' --notarization_pssw='${{ inputs.mac-notarization-pssw }}'" >> $GITHUB_OUTPUT + else + echo "not_setting=" >> $GITHUB_OUTPUT + fi - name: Set CodeSign Certificate macOS if: ${{ runner.os == 'macOS' && inputs.mac-certificate != ''}} uses: apple-actions/import-codesign-certs@v2 @@ -41,4 +62,4 @@ runs: - name: Deploy shell: bash run: | - bash scripts/${{ runner.os }}/2_deploy.sh --cert_pssw='${{ inputs.win-certificate-pssw }}' --cert_id='${{ inputs.mac-certificate-id }}' \ No newline at end of file + bash scripts/${{ runner.os }}/2_deploy.sh --cert_pssw='${{ inputs.win-certificate-pssw }}' --cert_id='${{ inputs.mac-certificate-id }}' ${{ steps.notarization.outputs.not_setting }} \ No newline at end of file diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index d4b541f3d..129273263 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -41,29 +41,8 @@ jobs: with: submodules: recursive ref: main - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - - name: Set CodeSign Certificate macOS - if: runner.os == 'macOS' - uses: apple-actions/import-codesign-certs@v2 - with: - p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} - p12-password: ${{ secrets.MACOS_CERTIFICATE_PSSW }} - - name: Set CodeSign Certificate Windows - if: runner.os == 'Windows' - run: | - New-Item -ItemType directory -Path certificate - Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_CERTIFICATE }}' - certutil -decode certificate\certificate.txt certificate\certificate.pfx - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - cache: true - version: ${{ env.QT_VERSION }} - - name: Install dependencies - shell: bash - run: | - bash scripts/${{ runner.os }}/0_setup_env.sh --dont_install_qt + - name: Setup Environment + uses: ./.github/actions/0_setup - name: Setup env variables id: envs shell: bash @@ -73,24 +52,23 @@ jobs: else echo "artifact_suffix=" >> $GITHUB_OUTPUT fi - - name: Cache external libraries sources - id: cache-ext-libs - uses: actions/cache@v3 - with: - path: src/external/downloads/* - key: ${{ runner.os }}-external-libraries - - name: Ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ runner.os }}-${{ github.ref }}-${{ matrix.precision }} - - name: Configure and Build - shell: bash - run: | - bash scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }} --ccache + - name: Build + uses: ./.github/actions/1_build + with: + cache-path: src/external/downloads/* + cache-key: external-libraries + build-option: ${{matrix.precision}} - name: Deploy - shell: bash - run: | - bash scripts/${{ runner.os }}/2_deploy.sh --cert_pssw='${{ secrets.WIN_CERTIFICATE_PSSW }}' --cert_id='${{ secrets.MACOS_CERT_ID }}' --notarization_user='${{ secrets.MACOS_NOTARIZATION_USER }}' --notarization_team='${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}' --notarization_pssw='${{ secrets.MACOS_NOTARIZATION_PSSW }}' + uses: ./.github/actions/2_deploy + with: + mac-certificate: ${{ secrets.MACOS_CERTIFICATE }} + mac-certificate-id: ${{ secrets.MACOS_CERT_ID }} + mac-certificate-pssw: ${{ secrets.MACOS_CERTIFICATE_PSSW }} + mac-notarization-user: ${{ secrets.MACOS_NOTARIZATION_USER }} + mac-notarization-team: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }} + mac-notarization-pssw: ${{ secrets.MACOS_NOTARIZATION_PSSW }} + win-certificate: ${{ secrets.WIN_CERTIFICATE }} + win-certificate-pssw: ${{ secrets.WIN_CERTIFICATE_PSSW }} - name: Upload MeshLab Portable uses: actions/upload-artifact@v3 with: From ac0fa3f42d8b5cd9bd7d3f143317c0c7e7a53a5f Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Fri, 23 Jun 2023 15:39:16 +0200 Subject: [PATCH 14/14] fix CreateRelease workflow --- .github/workflows/CreateRelease.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index 129273263..ea091dc19 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -52,12 +52,12 @@ jobs: else echo "artifact_suffix=" >> $GITHUB_OUTPUT fi - - name: Build - uses: ./.github/actions/1_build - with: - cache-path: src/external/downloads/* - cache-key: external-libraries - build-option: ${{matrix.precision}} + - name: Build + uses: ./.github/actions/1_build + with: + cache-path: src/external/downloads/* + cache-key: external-libraries + build-option: ${{matrix.precision}} - name: Deploy uses: ./.github/actions/2_deploy with: