From 56e0a14dbbc495f6d6b56fb223cb0fde348d2786 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 13 Oct 2024 01:19:13 -0700 Subject: [PATCH 01/11] Use more meaningful variable names in release workflows The project's templates include GitHub Actions workflows are used to automatically generate beta tester and production builds of Go-based projects. A separate build is generated for each of the target host types. This is done using a job matrix, which creates a parallel run of the workflow job for each target. The matrix defines variables that provide the data that is specific to each job. The variable names used previously did not clearly communicate their nature: - The variable for the task name was named "os" - The variables for the build filename components used the term "artifact", which is ambiguous in this context where the term is otherwise used to refer to the completely unrelated workflow artifacts These variable names made it very difficult for anyone not intimately familiar with the workings of the workflow to understand its code. --- .../publish-go-nightly-task.yml | 59 ++++++++++-------- workflow-templates/publish-go-tester-task.yml | 22 +++---- .../release-go-crosscompile-task.yml | 26 ++++---- workflow-templates/release-go-task.yml | 61 +++++++++++-------- 4 files changed, 93 insertions(+), 75 deletions(-) diff --git a/workflow-templates/publish-go-nightly-task.yml b/workflow-templates/publish-go-nightly-task.yml index 8299fba1..ed573425 100644 --- a/workflow-templates/publish-go-nightly-task.yml +++ b/workflow-templates/publish-go-nightly-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://docs.github.com/actions/using-workflows/events-that-trigger-workflows on: @@ -28,15 +28,24 @@ jobs: strategy: matrix: os: - - Windows_32bit - - Windows_64bit - - Linux_32bit - - Linux_64bit - - Linux_ARMv6 - - Linux_ARMv7 - - Linux_ARM64 - - macOS_64bit - - macOS_ARM64 + - 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 @@ -51,17 +60,17 @@ jobs: - name: Build env: NIGHTLY: true - run: task dist:${{ matrix.os }} + run: task dist:${{ matrix.os.task }} - name: Upload artifacts uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }} + name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.os.artifact-suffix }} path: ${{ env.DIST_DIR }} notarize-macos: - name: Notarize ${{ matrix.artifact.name }} + name: Notarize ${{ matrix.build.folder-suffix }} runs-on: macos-latest needs: create-nightly-artifacts @@ -77,11 +86,11 @@ jobs: strategy: matrix: - artifact: - - name: darwin_amd64 - path: "macOS_64bit.tar.gz" - - name: darwin_arm64 - path: "macOS_ARM64.tar.gz" + build: + - folder-suffix: darwin_amd64 + package-suffix: "macOS_64bit.tar.gz" + - folder-suffix: darwin_arm64 + package-suffix: "macOS_ARM64.tar.gz" steps: - name: Checkout repository @@ -90,7 +99,7 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: - pattern: ${{ env.ARTIFACT_NAME }}-* + pattern: ${{ env.ARTIFACT_PREFIX }}* merge-multiple: true path: ${{ env.DIST_DIR }} @@ -128,7 +137,7 @@ jobs: run: | cat > "${{ env.GON_CONFIG_PATH }}" <> $GITHUB_ENV @@ -169,7 +178,7 @@ jobs: uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }}-notarized-${{ matrix.artifact.name }} + name: ${{ env.ARTIFACT_PREFIX }}notarized-${{ matrix.build.folder-suffix }} path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }} publish-nightly: @@ -183,7 +192,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - pattern: ${{ env.ARTIFACT_NAME }}-* + pattern: ${{ env.ARTIFACT_PREFIX }}* merge-multiple: true path: ${{ env.DIST_DIR }} diff --git a/workflow-templates/publish-go-tester-task.yml b/workflow-templates/publish-go-tester-task.yml index 142d2d39..67e77c22 100644 --- a/workflow-templates/publish-go-tester-task.yml +++ b/workflow-templates/publish-go-tester-task.yml @@ -77,7 +77,7 @@ jobs: build: needs: package-name-prefix - name: Build ${{ matrix.os.name }} + name: Build ${{ matrix.os.artifact-name }} runs-on: ubuntu-latest permissions: contents: read @@ -87,31 +87,31 @@ jobs: os: - task: Windows_32bit path: "*Windows_32bit.zip" - name: Windows_X86-32 + artifact-name: Windows_X86-32 - task: Windows_64bit path: "*Windows_64bit.zip" - name: Windows_X86-64 + artifact-name: Windows_X86-64 - task: Linux_32bit path: "*Linux_32bit.tar.gz" - name: Linux_X86-32 + artifact-name: Linux_X86-32 - task: Linux_64bit path: "*Linux_64bit.tar.gz" - name: Linux_X86-64 + artifact-name: Linux_X86-64 - task: Linux_ARMv6 path: "*Linux_ARMv6.tar.gz" - name: Linux_ARMv6 + artifact-name: Linux_ARMv6 - task: Linux_ARMv7 path: "*Linux_ARMv7.tar.gz" - name: Linux_ARMv7 + artifact-name: Linux_ARMv7 - task: Linux_ARM64 path: "*Linux_ARM64.tar.gz" - name: Linux_ARM64 + artifact-name: Linux_ARM64 - task: macOS_64bit path: "*macOS_64bit.tar.gz" - name: macOS_64 + artifact-name: macOS_64 - task: macOS_ARM64 path: "*macOS_ARM64.tar.gz" - name: macOS_ARM64 + artifact-name: macOS_ARM64 steps: - name: Checkout repository @@ -134,7 +134,7 @@ jobs: uses: actions/upload-artifact@v4 with: path: ${{ env.DIST_DIR }}/${{ matrix.os.path }} - name: ${{ matrix.os.name }} + name: ${{ matrix.os.artifact-name }} checksums: needs: diff --git a/workflow-templates/release-go-crosscompile-task.yml b/workflow-templates/release-go-crosscompile-task.yml index e9d1e99b..d35b1130 100644 --- a/workflow-templates/release-go-crosscompile-task.yml +++ b/workflow-templates/release-go-crosscompile-task.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: - os: + task: - Windows_32bit - Windows_64bit - Linux_32bit @@ -45,7 +45,7 @@ jobs: - name: Create changelog # Avoid creating the same changelog for each os - if: matrix.os == 'Windows_32bit' + if: matrix.task == 'Windows_32bit' uses: arduino/create-changelog@v1 with: tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$' @@ -65,7 +65,7 @@ jobs: version: 3.x - name: Build - run: task dist:${{ matrix.os }} + run: task dist:${{ matrix.task }} - name: Upload artifacts uses: actions/upload-artifact@v3 @@ -75,7 +75,7 @@ jobs: path: ${{ env.DIST_DIR }} notarize-macos: - name: Notarize ${{ matrix.artifact.name }} + name: Notarize ${{ matrix.build.folder-suffix }} runs-on: macos-latest needs: create-release-artifacts permissions: @@ -86,11 +86,11 @@ jobs: strategy: matrix: - artifact: - - name: darwin_amd64 - path: "macOS_64bit.tar.gz" - - name: darwin_arm64 - path: "macOS_ARM64.tar.gz" + build: + - folder-suffix: darwin_amd64 + package-suffix: "macOS_64bit.tar.gz" + - folder-suffix: darwin_arm64 + package-suffix: "macOS_ARM64.tar.gz" steps: - name: Checkout repository @@ -136,7 +136,7 @@ jobs: run: | cat > "${{ env.GON_CONFIG_PATH }}" <> $GITHUB_ENV diff --git a/workflow-templates/release-go-task.yml b/workflow-templates/release-go-task.yml index 3624a226..1d20c4e0 100644 --- a/workflow-templates/release-go-task.yml +++ b/workflow-templates/release-go-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- on: push: @@ -25,15 +25,24 @@ jobs: strategy: matrix: os: - - Windows_32bit - - Windows_64bit - - Linux_32bit - - Linux_64bit - - Linux_ARMv6 - - Linux_ARMv7 - - Linux_ARM64 - - macOS_64bit - - macOS_ARM64 + - 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 @@ -43,7 +52,7 @@ jobs: - name: Create changelog # Avoid creating the same changelog for each os - if: matrix.os == 'Windows_32bit' + if: matrix.os.task == 'Windows_32bit' uses: arduino/create-changelog@v1 with: tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$' @@ -58,17 +67,17 @@ jobs: version: 3.x - name: Build - run: task dist:${{ matrix.os }} + run: task dist:${{ matrix.os.task }} - name: Upload artifacts uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }} + name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.os.artifact-suffix }} path: ${{ env.DIST_DIR }} notarize-macos: - name: Notarize ${{ matrix.artifact.name }} + name: Notarize ${{ matrix.build.folder-suffix }} runs-on: macos-latest needs: create-release-artifacts outputs: @@ -82,11 +91,11 @@ jobs: strategy: matrix: - artifact: - - name: darwin_amd64 - path: "macOS_64bit.tar.gz" - - name: darwin_arm64 - path: "macOS_ARM64.tar.gz" + build: + - folder-suffix: darwin_amd64 + package-suffix: "macOS_64bit.tar.gz" + - folder-suffix: darwin_arm64 + package-suffix: "macOS_ARM64.tar.gz" steps: - name: Checkout repository @@ -95,7 +104,7 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: - pattern: ${{ env.ARTIFACT_NAME }}-* + pattern: ${{ env.ARTIFACT_PREFIX }}* merge-multiple: true path: ${{ env.DIST_DIR }} @@ -133,7 +142,7 @@ jobs: run: | cat > "${{ env.GON_CONFIG_PATH }}" <> $GITHUB_ENV @@ -174,7 +183,7 @@ jobs: uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ${{ env.ARTIFACT_NAME }}-notarized-${{ matrix.artifact.name }} + name: ${{ env.ARTIFACT_PREFIX }}notarized-${{ matrix.build.folder-suffix }} path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }} create-release: @@ -189,7 +198,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - pattern: ${{ env.ARTIFACT_NAME }}-* + pattern: ${{ env.ARTIFACT_PREFIX }}* merge-multiple: true path: ${{ env.DIST_DIR }} From bbd5c126a411dff63845a5b0524f00fdf30c3a43 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 13 Oct 2024 01:21:31 -0700 Subject: [PATCH 02/11] Use environment variable to define build folder name in "Release" workflows Multiple commands in the release workflows include the path of the folder that contains the build output. Previously, the complex folder name was specified redundantly in each instance. The readability and maintainability of the workflow is improved by using an environment variable to define the folder name in a single place, then referencing that environment variable in each of the individual commands that use the path. --- workflow-templates/publish-go-nightly-task.yml | 11 ++++++++--- workflow-templates/release-go-crosscompile-task.yml | 11 ++++++++--- workflow-templates/release-go-task.yml | 11 ++++++++--- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/workflow-templates/publish-go-nightly-task.yml b/workflow-templates/publish-go-nightly-task.yml index ed573425..a1884b4e 100644 --- a/workflow-templates/publish-go-nightly-task.yml +++ b/workflow-templates/publish-go-nightly-task.yml @@ -93,6 +93,11 @@ jobs: package-suffix: "macOS_ARM64.tar.gz" steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable + echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV" + - name: Checkout repository uses: actions/checkout@v4 @@ -137,7 +142,7 @@ jobs: run: | cat > "${{ env.GON_CONFIG_PATH }}" <> $GITHUB_ENV diff --git a/workflow-templates/release-go-crosscompile-task.yml b/workflow-templates/release-go-crosscompile-task.yml index d35b1130..37e1f16a 100644 --- a/workflow-templates/release-go-crosscompile-task.yml +++ b/workflow-templates/release-go-crosscompile-task.yml @@ -93,6 +93,11 @@ jobs: package-suffix: "macOS_ARM64.tar.gz" steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable + echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV" + - name: Checkout repository uses: actions/checkout@v4 @@ -136,7 +141,7 @@ jobs: run: | cat > "${{ env.GON_CONFIG_PATH }}" <> $GITHUB_ENV diff --git a/workflow-templates/release-go-task.yml b/workflow-templates/release-go-task.yml index 1d20c4e0..cdf74b9d 100644 --- a/workflow-templates/release-go-task.yml +++ b/workflow-templates/release-go-task.yml @@ -98,6 +98,11 @@ jobs: package-suffix: "macOS_ARM64.tar.gz" steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable + echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV" + - name: Checkout repository uses: actions/checkout@v4 @@ -142,7 +147,7 @@ jobs: run: | cat > "${{ env.GON_CONFIG_PATH }}" <> $GITHUB_ENV From 23f008df39890d42cb863f3953a70b4d1c1c21a0 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 13 Oct 2024 01:23:07 -0700 Subject: [PATCH 03/11] Move definition of package filename to dedicated step in "Release" workflows The package filename is referenced in multiple places in the release workflows. In order to avoid code duplication, it is defined once as an environment variable, then that variable referenced in each of the instances where the filename is needed. Previously, this was done by first defining and referencing a shell environment variable at the point of the first usage, then defining a workflow environment variable and referencing that in the second usage. The maintainability and readability of the workflow is improved by using a single workflow environment variable, defined in the step dedicated to defining such variables, then referencing it consistently in all usages. --- workflow-templates/release-go-crosscompile-task.yml | 7 +++---- workflow-templates/release-go-task.yml | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/workflow-templates/release-go-crosscompile-task.yml b/workflow-templates/release-go-crosscompile-task.yml index 37e1f16a..c39fe459 100644 --- a/workflow-templates/release-go-crosscompile-task.yml +++ b/workflow-templates/release-go-crosscompile-task.yml @@ -97,6 +97,8 @@ jobs: run: | # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV" + TAG="${GITHUB_REF/refs\/tags\//}" + echo "PACKAGE_FILENAME=${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.build.package-suffix }}" >> $GITHUB_ENV - name: Checkout repository uses: actions/checkout@v4 @@ -171,12 +173,9 @@ jobs: # GitHub's upload/download-artifact actions don't preserve file permissions, # so we need to add execution permission back until the action is made to do this. chmod +x "${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}" - TAG="${GITHUB_REF/refs\/tags\//}" - PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.build.package-suffix }}" - tar -czvf "$PACKAGE_FILENAME" \ + tar -czvf "${{ env.PACKAGE_FILENAME }}" \ -C "${{ env.BUILD_FOLDER }}/" "${{ env.PROJECT_NAME }}" \ -C ../../ LICENSE.txt - echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV - name: Upload artifact uses: actions/upload-artifact@v3 diff --git a/workflow-templates/release-go-task.yml b/workflow-templates/release-go-task.yml index cdf74b9d..16811aea 100644 --- a/workflow-templates/release-go-task.yml +++ b/workflow-templates/release-go-task.yml @@ -102,6 +102,8 @@ jobs: run: | # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV" + TAG="${GITHUB_REF/refs\/tags\//}" + echo "PACKAGE_FILENAME=${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.build.package-suffix }}" >> $GITHUB_ENV - name: Checkout repository uses: actions/checkout@v4 @@ -177,12 +179,9 @@ jobs: # GitHub's upload/download-artifact actions don't preserve file permissions, # so we need to add execution permission back until the action is made to do this. chmod +x "${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}" - TAG="${GITHUB_REF/refs\/tags\//}" - PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.build.package-suffix }}" - tar -czvf "$PACKAGE_FILENAME" \ + tar -czvf "${{ env.PACKAGE_FILENAME }}" \ -C "${{ env.BUILD_FOLDER }}/" "${{ env.PROJECT_NAME }}" \ -C ../../ LICENSE.txt - echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV - name: Upload artifact uses: actions/upload-artifact@v4 From 92c2bd337d90cfa1f28c0e7e04bd7f53fbce946a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:49:27 +0000 Subject: [PATCH 04/11] Bump actions/upload-artifact from 3 to 4 in /workflow-templates Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- workflow-templates/check-npm-dependencies-task.yml | 2 +- workflow-templates/release-go-crosscompile-task.yml | 4 ++-- workflow-templates/sync-labels-npm.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/workflow-templates/check-npm-dependencies-task.yml b/workflow-templates/check-npm-dependencies-task.yml index 572af0e8..88505108 100644 --- a/workflow-templates/check-npm-dependencies-task.yml +++ b/workflow-templates/check-npm-dependencies-task.yml @@ -111,7 +111,7 @@ jobs: # Some might find it convenient to have CI generate the cache rather than setting up for it locally - name: Upload cache to workflow artifact if: failure() && steps.diff.outcome == 'failure' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error include-hidden-files: true diff --git a/workflow-templates/release-go-crosscompile-task.yml b/workflow-templates/release-go-crosscompile-task.yml index c39fe459..578ea704 100644 --- a/workflow-templates/release-go-crosscompile-task.yml +++ b/workflow-templates/release-go-crosscompile-task.yml @@ -68,7 +68,7 @@ jobs: run: task dist:${{ matrix.task }} - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: ${{ env.ARTIFACT_NAME }} @@ -178,7 +178,7 @@ jobs: -C ../../ LICENSE.txt - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: ${{ env.ARTIFACT_NAME }} diff --git a/workflow-templates/sync-labels-npm.yml b/workflow-templates/sync-labels-npm.yml index a6714cdb..f7574f6e 100644 --- a/workflow-templates/sync-labels-npm.yml +++ b/workflow-templates/sync-labels-npm.yml @@ -83,7 +83,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml From 18ed8f1ccf90613744314907ef2f33ecd02f5780 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:37:28 +0000 Subject: [PATCH 05/11] Bump actions/upload-artifact from 3 to 4 in /.github/workflows Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-clang-format.yml | 6 +++--- .github/workflows/sync-labels-npm.yml | 2 +- .github/workflows/test-install-script.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-clang-format.yml b/.github/workflows/check-clang-format.yml index 4bd8fb0d..6ab4bb81 100644 --- a/.github/workflows/check-clang-format.yml +++ b/.github/workflows/check-clang-format.yml @@ -130,7 +130,7 @@ jobs: if: > always() && steps.check.outcome == 'failure' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ${{ env.WORKING_FOLDER }}/expected/.clang-format if-no-files-found: error @@ -190,7 +190,7 @@ jobs: if: > always() && steps.check.outcome == 'failure' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ${{ env.WORKING_FOLDER }}/output if-no-files-found: error @@ -245,7 +245,7 @@ jobs: OUTPUT_PATH="${{ env.CONVERSION_OUTPUT_PATH }}" - name: Save conversion to a workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ${{ env.CONVERSION_OUTPUT_PATH }} if-no-files-found: error diff --git a/.github/workflows/sync-labels-npm.yml b/.github/workflows/sync-labels-npm.yml index a6714cdb..f7574f6e 100644 --- a/.github/workflows/sync-labels-npm.yml +++ b/.github/workflows/sync-labels-npm.yml @@ -83,7 +83,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml diff --git a/.github/workflows/test-install-script.yml b/.github/workflows/test-install-script.yml index 5384ca3a..c47116fa 100644 --- a/.github/workflows/test-install-script.yml +++ b/.github/workflows/test-install-script.yml @@ -53,7 +53,7 @@ jobs: "${{ env.SCRIPT_FOLDER }}/${{ env.SCRIPT_NAME }}" - name: Save configured script as workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error path: ${{ env.SCRIPT_FOLDER }}/${{ env.SCRIPT_NAME }} From 13093e12e274349296567a341496a877433fb27c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:49:36 +0000 Subject: [PATCH 06/11] Bump actions/download-artifact from 3 to 4 in /workflow-templates Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- workflow-templates/release-go-crosscompile-task.yml | 4 ++-- workflow-templates/sync-labels-npm.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/workflow-templates/release-go-crosscompile-task.yml b/workflow-templates/release-go-crosscompile-task.yml index 578ea704..a6a09904 100644 --- a/workflow-templates/release-go-crosscompile-task.yml +++ b/workflow-templates/release-go-crosscompile-task.yml @@ -104,7 +104,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} path: ${{ env.DIST_DIR }} @@ -194,7 +194,7 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} path: ${{ env.DIST_DIR }} diff --git a/workflow-templates/sync-labels-npm.yml b/workflow-templates/sync-labels-npm.yml index f7574f6e..71b76bdd 100644 --- a/workflow-templates/sync-labels-npm.yml +++ b/workflow-templates/sync-labels-npm.yml @@ -124,7 +124,7 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From 58012ae878495364153cccc386767554f9ead697 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:38:04 +0000 Subject: [PATCH 07/11] Bump actions/download-artifact from 3 to 4 in /.github/workflows Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels-npm.yml | 2 +- .github/workflows/test-install-script.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-labels-npm.yml b/.github/workflows/sync-labels-npm.yml index f7574f6e..71b76bdd 100644 --- a/.github/workflows/sync-labels-npm.yml +++ b/.github/workflows/sync-labels-npm.yml @@ -124,7 +124,7 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} diff --git a/.github/workflows/test-install-script.yml b/.github/workflows/test-install-script.yml index c47116fa..76d23d43 100644 --- a/.github/workflows/test-install-script.yml +++ b/.github/workflows/test-install-script.yml @@ -75,7 +75,7 @@ jobs: steps: - name: Download script artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.SCRIPT_ARTIFACT_NAME }} @@ -114,7 +114,7 @@ jobs: echo "BINDIR=${{ runner.temp }}/custom-installation-folder" >> "$GITHUB_ENV" - name: Download script artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.SCRIPT_ARTIFACT_NAME }} @@ -151,7 +151,7 @@ jobs: steps: - name: Download script artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.SCRIPT_ARTIFACT_NAME }} @@ -184,7 +184,7 @@ jobs: steps: - name: Download script artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.SCRIPT_ARTIFACT_NAME }} @@ -228,7 +228,7 @@ jobs: echo "SECOND_BINDIR=${{ runner.temp }}/${SECOND_INSTALLATION_FOLDER}" >> "$GITHUB_ENV" - name: Download script artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.SCRIPT_ARTIFACT_NAME }} From c0e664c16652bca4d79f02b50f5d30a0e5fc483c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:48:34 +0000 Subject: [PATCH 08/11] Bump geekyeggo/delete-artifact from 2 to 5 in /workflow-templates Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 to 5. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v2...v5) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- workflow-templates/sync-labels-npm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow-templates/sync-labels-npm.yml b/workflow-templates/sync-labels-npm.yml index 71b76bdd..2643c441 100644 --- a/workflow-templates/sync-labels-npm.yml +++ b/workflow-templates/sync-labels-npm.yml @@ -130,7 +130,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v5 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From f5c9530fc53d9fc4aca9c323fc018daeecd6645f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 11:00:18 +0000 Subject: [PATCH 09/11] Bump geekyeggo/delete-artifact from 2 to 5 in /.github/workflows Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 to 5. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v2...v5) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels-npm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels-npm.yml b/.github/workflows/sync-labels-npm.yml index 71b76bdd..2643c441 100644 --- a/.github/workflows/sync-labels-npm.yml +++ b/.github/workflows/sync-labels-npm.yml @@ -130,7 +130,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v5 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From a4efefd0cb8c96bb975f33140dc3d3f7c5ed98cb Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 12 Oct 2024 22:19:13 -0700 Subject: [PATCH 10/11] Don't upload multiple times to same artifact in label sync workflows The "Sync Labels" GitHub Actions workflows are configured to allow the use of multiple shared label configuration files. This is done by using a job matrix in the GitHub Actions workflow to download each of the files from the source repository in a parallel GitHub Actions workflow job. A GitHub Actions workflow artifact was used to transfer the generated files between sequential jobs in the workflow. The "actions/upload-artifact" and "actions/download-artifact" actions are used for this purpose. Previously, a single artifact was used for the transfer of all the shared label configuration files, with each of the parallel jobs uploading its own generated files to that artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary to use a dedicated artifact for each of the builds. These can be downloaded in aggregate by using the artifact name globbing and merging features which were introduced in version 4.1.0 of the "actions/download-artifact" action. --- .github/workflows/sync-labels-npm.yml | 13 +++++++------ workflow-templates/sync-labels-npm.yml | 13 +++++++------ workflow-templates/sync-labels.yml | 12 ++++++------ 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/sync-labels-npm.yml b/.github/workflows/sync-labels-npm.yml index 2643c441..a73176ee 100644 --- a/.github/workflows/sync-labels-npm.yml +++ b/.github/workflows/sync-labels-npm.yml @@ -5,7 +5,7 @@ env: # See: https://github.com/actions/setup-node/#readme NODE_VERSION: 16.x CONFIGURATIONS_FOLDER: .github/label-configuration-files - CONFIGURATIONS_ARTIFACT: label-configuration-files + CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows on: @@ -89,7 +89,7 @@ jobs: *.yaml *.yml if-no-files-found: error - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} sync: needs: download @@ -123,16 +123,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download configuration files artifact + - name: Download configuration file artifacts uses: actions/download-artifact@v4 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + merge-multiple: true + pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* path: ${{ env.CONFIGURATIONS_FOLDER }} - - name: Remove unneeded artifact + - name: Remove unneeded artifacts uses: geekyeggo/delete-artifact@v5 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* - name: Setup Node.js uses: actions/setup-node@v4 diff --git a/workflow-templates/sync-labels-npm.yml b/workflow-templates/sync-labels-npm.yml index 2643c441..a73176ee 100644 --- a/workflow-templates/sync-labels-npm.yml +++ b/workflow-templates/sync-labels-npm.yml @@ -5,7 +5,7 @@ env: # See: https://github.com/actions/setup-node/#readme NODE_VERSION: 16.x CONFIGURATIONS_FOLDER: .github/label-configuration-files - CONFIGURATIONS_ARTIFACT: label-configuration-files + CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows on: @@ -89,7 +89,7 @@ jobs: *.yaml *.yml if-no-files-found: error - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} sync: needs: download @@ -123,16 +123,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download configuration files artifact + - name: Download configuration file artifacts uses: actions/download-artifact@v4 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + merge-multiple: true + pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* path: ${{ env.CONFIGURATIONS_FOLDER }} - - name: Remove unneeded artifact + - name: Remove unneeded artifacts uses: geekyeggo/delete-artifact@v5 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* - name: Setup Node.js uses: actions/setup-node@v4 diff --git a/workflow-templates/sync-labels.yml b/workflow-templates/sync-labels.yml index 6e969cff..73fa7e15 100644 --- a/workflow-templates/sync-labels.yml +++ b/workflow-templates/sync-labels.yml @@ -19,7 +19,7 @@ on: env: CONFIGURATIONS_FOLDER: .github/label-configuration-files - CONFIGURATIONS_ARTIFACT: label-configuration-files + CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- jobs: check: @@ -79,7 +79,7 @@ jobs: *.yaml *.yml if-no-files-found: error - name: ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} sync: needs: download @@ -113,17 +113,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download configuration files artifact + - name: Download configuration file artifacts uses: actions/download-artifact@v4 with: - pattern: ${{ env.CONFIGURATIONS_ARTIFACT }}-* merge-multiple: true + pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* path: ${{ env.CONFIGURATIONS_FOLDER }} - - name: Remove unneeded artifact + - name: Remove unneeded artifacts uses: geekyeggo/delete-artifact@v5 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }}-* + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* - name: Merge label configuration files run: | From 6cd34f76b2f43fa788b53e3cca2c4e81cd739883 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 13 Oct 2024 01:29:24 -0700 Subject: [PATCH 11/11] Don't upload multiple times to same artifact in "Release" workflow (Go, Task, Crosscompile) The template's "Release" GitHub Actions workflow generates binaries for a range of target hosts. This is done by using a job matrix that produces each build in a parallel job. GitHub Actions workflow artifacts are used to transfer the generated files between sequential jobs in the workflow. The "actions/upload-artifact" and "actions/download-artifact" actions are used for this purpose. Previously, a single artifact was used for this purpose, with each of the parallel jobs uploading its own generated files to that artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary to use a dedicated artifact for each of the builds. These can be downloaded in aggregate by using the artifact name globbing and merging features which were introduced in version 4.1.0 of the "actions/download-artifact" action. --- .../release-go-crosscompile-task.yml | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) 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}}