diff --git a/workflow-templates/release-go-crosscompile-task.yml b/workflow-templates/release-go-crosscompile-task.yml index a6a09904..a6301e3a 100644 --- a/workflow-templates/release-go-crosscompile-task.yml +++ b/workflow-templates/release-go-crosscompile-task.yml @@ -9,7 +9,7 @@ env: # The project's folder on Arduino's download server for uploading builds AWS_PLUGIN_TARGET: TODO_AWS_PLUGIN_TARGET AWS_REGION: "us-east-1" - ARTIFACT_NAME: dist + ARTIFACT_PREFIX: dist- # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax GO_VERSION: "1.17" @@ -26,16 +26,25 @@ jobs: strategy: matrix: - task: - - Windows_32bit - - Windows_64bit - - Linux_32bit - - Linux_64bit - - Linux_ARMv6 - - Linux_ARMv7 - - Linux_ARM64 - - macOS_64bit - - macOS_ARM64 + os: + - task: Windows_32bit + artifact-suffix: Windows_32bit + - task: Windows_64bit + artifact-suffix: Windows_64bit + - task: Linux_32bit + artifact-suffix: Linux_32bit + - task: Linux_64bit + artifact-suffix: Linux_64bit + - task: Linux_ARMv6 + artifact-suffix: Linux_ARMv6 + - task: Linux_ARMv7 + artifact-suffix: Linux_ARMv7 + - task: Linux_ARM64 + artifact-suffix: Linux_ARM64 + - task: macOS_64bit + artifact-suffix: macOS_64bit + - task: macOS_ARM64 + artifact-suffix: macOS_ARM64 steps: - name: Checkout repository @@ -45,7 +54,7 @@ jobs: - name: Create changelog # Avoid creating the same changelog for each os - if: matrix.task == 'Windows_32bit' + if: matrix.os.task == 'Windows_32bit' uses: arduino/create-changelog@v1 with: tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$' @@ -65,17 +74,17 @@ jobs: version: 3.x - name: Build - run: task dist:${{ matrix.task }} + run: task dist:${{ matrix.os.task }} - name: Upload artifacts uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.os.artifact-suffix }} path: ${{ env.DIST_DIR }} notarize-macos: - name: Notarize ${{ matrix.build.folder-suffix }} + name: Notarize ${{ matrix.build.artifact-suffix }} runs-on: macos-latest needs: create-release-artifacts permissions: @@ -87,9 +96,11 @@ jobs: strategy: matrix: build: - - folder-suffix: darwin_amd64 + - artifact-suffix: macOS_64bit + folder-suffix: darwin_amd64 package-suffix: "macOS_64bit.tar.gz" - - folder-suffix: darwin_arm64 + - artifact-suffix: macOS_ARM64 + folder-suffix: darwin_arm64 package-suffix: "macOS_ARM64.tar.gz" steps: @@ -106,9 +117,14 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }} path: ${{ env.DIST_DIR }} + - name: Remove non-notarized artifact + uses: geekyeggo/delete-artifact@v5 + with: + name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }} + - name: Import Code-Signing Certificates env: KEYCHAIN: "sign.keychain" @@ -177,11 +193,11 @@ jobs: -C "${{ env.BUILD_FOLDER }}/" "${{ env.PROJECT_NAME }}" \ -C ../../ LICENSE.txt - - name: Upload artifact + - name: Upload notarized artifact uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }} path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }} create-release: @@ -196,8 +212,9 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: ${{ env.ARTIFACT_NAME }} + merge-multiple: true path: ${{ env.DIST_DIR }} + pattern: ${{ env.ARTIFACT_PREFIX }}* - name: Create checksum file working-directory: ${{ env.DIST_DIR}}