From f599f140cbaf88dd52e6f23189f417b626bd5f42 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 4 Nov 2022 02:39:53 -0700 Subject: [PATCH 1/3] [skip changelog] Add missing checkout steps to build publishing workflow jobs GitHub Actions workflows are used to automatically generate nightly builds and production releases of the project. A workflow job is dedicated to the publishing of the build. Previously, this job only needed to download the workflow artifact containing the build filess created by the previous job, generate a checksum file, and upload the builds to Arduino's server. None of these operations had any need for the contents of the repository, so a checkout step was not added to the job. An additional operation was recently added to the publishing job: the generation of archives containing the protocol buffer files to publish along with the builds. This new operation does require the contents of the repository. A checkout step was not added to the job at that time, which caused the protocol buffer generation step and the publishing job to fail: task: No Taskfile found in "/home/runner/work/arduino-cli/arduino-cli". Use "task --init" to create a new one The problem is resolved by adding a step that uses the `actions/checkout` GitHub Actions action to checkout the Arduino CLI repository into the runner machine to make it available for use in that job. --- .github/workflows/publish-go-nightly-task.yml | 3 +++ .github/workflows/release-go-task.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/publish-go-nightly-task.yml b/.github/workflows/publish-go-nightly-task.yml index 52ccdce2ba5..bb86b6d79db 100644 --- a/.github/workflows/publish-go-nightly-task.yml +++ b/.github/workflows/publish-go-nightly-task.yml @@ -230,6 +230,9 @@ jobs: - create-windows-installer steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Download artifact uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/release-go-task.yml b/.github/workflows/release-go-task.yml index 1924c110d67..b059d60925d 100644 --- a/.github/workflows/release-go-task.yml +++ b/.github/workflows/release-go-task.yml @@ -235,6 +235,9 @@ jobs: - create-windows-installer steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Download artifact uses: actions/download-artifact@v3 with: From a177740422ac65a0977f5dffa48312dbdb3a24e4 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 4 Nov 2022 03:07:51 -0700 Subject: [PATCH 2/3] [skip changelog] Don't error protobuf archive task if distribution folder already exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `protoc:collect` task generates a ZIP archive of the project's protocol buffer files for inclusion with the published builds. In the case of the nightly and release build workflows, the distribution folder the archive is generated into was already created by the build operations in the preceeding workflow job. Previously, the task (and thus entire build workflow) would fail in this case when attempting to create the folder that already exists: mkdir: cannot create directory ‘../dist’: File exists In addition to the obvious purpose, the `--parents` flag of the `mkdir` command also has the following additional effect: > no error if existing So adding this flag to the command resolves the spurious failure. It will create the folder when necessary, but simply carry on with the rest of the task when it does exist. --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index a793036b136..a143e51a286 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -236,7 +236,7 @@ tasks: desc: Create a zip file containing all .proto files in DIST_DIR dir: rpc cmds: - - mkdir ../{{.DIST_DIR}} + - mkdir --parents ../{{.DIST_DIR}} - zip -r ../{{.DIST_DIR}}/{{.PROJECT_NAME}}_{{.VERSION}}_proto.zip * -i \*.proto protoc:format: From 973a4ec12cf9619677e0f9a8e0527286b35ffbad Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 5 Nov 2022 03:39:08 -0700 Subject: [PATCH 3/3] [skip changelog] Set correct version for nightly build protobuf archive filename Different version identifiers are used for the build archive filenames depending on the type of build: Local: git-snapshot Tester: test--git-snapshot Nightly: nightly- Production: The use of a nightly build version format is specified by setting the `NIGHTLY` environment variable to `true` in the GitHub Actions workflow. An additional step was recently added to the build workflows: the generation of archives of protocol buffer files to publish along with the builds. The setting of the `NIGHTLY` environment variable in that step was neglected in the nightly build workflow, which caused the protocol buffer archive file to be named with the local build version identifier instead of the nightly build version identifier. This also resulted in the protocol buffer archive file not being added to the checksums file. --- .github/workflows/publish-go-nightly-task.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-go-nightly-task.yml b/.github/workflows/publish-go-nightly-task.yml index bb86b6d79db..12c4f33c609 100644 --- a/.github/workflows/publish-go-nightly-task.yml +++ b/.github/workflows/publish-go-nightly-task.yml @@ -246,6 +246,8 @@ jobs: version: 3.x - name: Collect proto files + env: + NIGHTLY: true run: task protoc:collect - name: Create checksum file