From ce44ee4bab646e0a8e5902cfdc94070012423c9e Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Wed, 19 Oct 2022 16:23:14 +0200 Subject: [PATCH 1/8] Add task to zip all .proto files for release --- Taskfile.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index 23a2b6561aa..86ca98cd289 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -215,6 +215,13 @@ tasks: cmds: - buf lint rpc + protoc:collect: + desc: Create a zip file containing all .proto files in DIST_DIR + dir: rpc + cmds: + - mkdir ../{{.DIST_DIR}} + - zip -r ../{{.DIST_DIR}}/{{.PROJECT_NAME}}_{{.VERSION}}_proto.zip * -i \*.proto + protoc:format: desc: Perform formatting of the protobuf definitions cmds: From d79ec4825eb605983102161266cc16aa5487a235 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Wed, 19 Oct 2022 16:31:47 +0200 Subject: [PATCH 2/8] Add proto files in nightly released files --- .github/workflows/publish-go-nightly-task.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/publish-go-nightly-task.yml b/.github/workflows/publish-go-nightly-task.yml index 821673c8ce0..c42b526d1ff 100644 --- a/.github/workflows/publish-go-nightly-task.yml +++ b/.github/workflows/publish-go-nightly-task.yml @@ -236,6 +236,15 @@ jobs: name: ${{ env.ARTIFACT_NAME }} path: ${{ env.DIST_DIR }} + - name: Install Task + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Collect proto files + run: task protoc:collect + - name: Create checksum file working-directory: ${{ env.DIST_DIR}} run: | From 0c44da8689388c57b88dbd1f8abc7a5c274addcd Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Wed, 19 Oct 2022 16:32:05 +0200 Subject: [PATCH 3/8] Add proto files in tester released files --- .github/workflows/publish-go-tester-task.yml | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index b730416c4c8..dac73da218e 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -132,6 +132,32 @@ jobs: path: ${{ env.DIST_DIR }}/${{ matrix.os.path }} name: ${{ matrix.os.name }} + proto-files: + needs: + - package-name-prefix + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Task + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Collect proto files + run: task protoc:collect + + - name: Upload proto files zip + uses: actions/upload-artifact@v3 + with: + path: ${{ env.DIST_DIR }}/*.zip + name: rpc-protocol-files + checksums: needs: - build From ee099137ffe33503c60762f1017185596f9bddda Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Wed, 19 Oct 2022 16:32:17 +0200 Subject: [PATCH 4/8] Add proto files in stable released files --- .github/workflows/release-go-task.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release-go-task.yml b/.github/workflows/release-go-task.yml index 5d026f422bb..892f613a4b4 100644 --- a/.github/workflows/release-go-task.yml +++ b/.github/workflows/release-go-task.yml @@ -256,6 +256,15 @@ jobs: unzip -p /tmp/3.0.0.zip semver-tool-3.0.0/src/semver >/tmp/semver && chmod +x /tmp/semver if [[ "$(/tmp/semver get prerel ${{ needs.create-release-artifacts.outputs.version }} )" ]]; then echo "::set-output name=IS_PRE::true"; fi + - name: Install Task + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Collect proto files + run: task protoc:collect + - name: Create Github Release and upload artifacts uses: ncipollo/release-action@v1 with: From 32c1c30f5d50442c1017be2ffdea8e694a7e7622 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Wed, 19 Oct 2022 17:15:04 +0200 Subject: [PATCH 5/8] Fix tester build workflow --- .github/workflows/publish-go-tester-task.yml | 58 +++++++++++--------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index dac73da218e..8d5dc85e49d 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -132,32 +132,6 @@ jobs: path: ${{ env.DIST_DIR }}/${{ matrix.os.path }} name: ${{ matrix.os.name }} - proto-files: - needs: - - package-name-prefix - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x - - - name: Collect proto files - run: task protoc:collect - - - name: Upload proto files zip - uses: actions/upload-artifact@v3 - with: - path: ${{ env.DIST_DIR }}/*.zip - name: rpc-protocol-files - checksums: needs: - build @@ -185,3 +159,35 @@ jobs: with: path: ./*checksums.txt name: checksums + + proto-files: + # Run this after checksums or the uploaded proto files zip + # will make the checksum job always fail + needs: + - checksums + - package-name-prefix + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Task + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Collect proto files + run: | + PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }} + export PACKAGE_NAME_PREFIX + task protoc:collect + + - name: Upload proto files zip + uses: actions/upload-artifact@v3 + with: + path: ${{ env.DIST_DIR }}/*.zip + name: rpc-protocol-files From bbb662a236b0d1bafb0e735ebf7246c1ade02339 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Thu, 20 Oct 2022 14:49:04 +0200 Subject: [PATCH 6/8] Fix checksums.txt creation in tester and stable build releases --- .github/workflows/publish-go-tester-task.yml | 60 ++++++++++---------- .github/workflows/release-go-task.yml | 18 +++--- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 8d5dc85e49d..589e74cfd2a 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -132,39 +132,8 @@ jobs: path: ${{ env.DIST_DIR }}/${{ matrix.os.path }} name: ${{ matrix.os.name }} - checksums: - needs: - - build - - package-name-prefix - runs-on: ubuntu-latest - - steps: - - name: Download build artifacts - uses: actions/download-artifact@v3 - - - name: Output checksum - run: | - TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot" - declare -a artifacts=($(ls -d */)) - for artifact in ${artifacts[@]} - do - cd $artifact - checksum=$(sha256sum ${{ env.PROJECT_NAME }}_${TAG}*) - cd .. - echo $checksum >> ${TAG}-checksums.txt - done - - - name: Upload checksum artifact - uses: actions/upload-artifact@v3 - with: - path: ./*checksums.txt - name: checksums - proto-files: - # Run this after checksums or the uploaded proto files zip - # will make the checksum job always fail needs: - - checksums - package-name-prefix runs-on: ubuntu-latest @@ -191,3 +160,32 @@ jobs: with: path: ${{ env.DIST_DIR }}/*.zip name: rpc-protocol-files + + checksums: + needs: + - build + - proto-files + - package-name-prefix + runs-on: ubuntu-latest + + steps: + - name: Download build artifacts + uses: actions/download-artifact@v3 + + - name: Output checksum + run: | + TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot" + declare -a artifacts=($(ls -d */)) + for artifact in ${artifacts[@]} + do + cd $artifact + checksum=$(sha256sum ${{ env.PROJECT_NAME }}_${TAG}*) + cd .. + echo $checksum >> ${TAG}-checksums.txt + done + + - name: Upload checksum artifact + uses: actions/upload-artifact@v3 + with: + path: ./*checksums.txt + name: checksums diff --git a/.github/workflows/release-go-task.yml b/.github/workflows/release-go-task.yml index 892f613a4b4..f74a1c7c543 100644 --- a/.github/workflows/release-go-task.yml +++ b/.github/workflows/release-go-task.yml @@ -241,6 +241,15 @@ jobs: name: ${{ env.ARTIFACT_NAME }} path: ${{ env.DIST_DIR }} + - name: Install Task + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Collect proto files + run: task protoc:collect + - name: Create checksum file working-directory: ${{ env.DIST_DIR}} run: | @@ -256,15 +265,6 @@ jobs: unzip -p /tmp/3.0.0.zip semver-tool-3.0.0/src/semver >/tmp/semver && chmod +x /tmp/semver if [[ "$(/tmp/semver get prerel ${{ needs.create-release-artifacts.outputs.version }} )" ]]; then echo "::set-output name=IS_PRE::true"; fi - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x - - - name: Collect proto files - run: task protoc:collect - - name: Create Github Release and upload artifacts uses: ncipollo/release-action@v1 with: From ab741fd11918aeb82639c563ff34af3b88843781 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Tue, 25 Oct 2022 09:41:45 +0200 Subject: [PATCH 7/8] Change build job of tester build workflow to be generic --- .github/workflows/publish-go-tester-task.yml | 63 ++++++-------------- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 589e74cfd2a..d14bfbe2a9a 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -71,41 +71,44 @@ jobs: echo "::set-output name=prefix::$PACKAGE_NAME_PREFIX" - build: + create-artifacts: needs: package-name-prefix - name: Build ${{ matrix.os.name }} + name: Create artifact ${{ matrix.artifact.name }} runs-on: ubuntu-latest strategy: matrix: - os: - - task: Windows_32bit + artifact: + - task: dist:Windows_32bit path: "*Windows_32bit.zip" name: Windows_X86-32 - - task: Windows_64bit + - task: dist:Windows_64bit path: "*Windows_64bit.zip" name: Windows_X86-64 - - task: Linux_32bit + - task: dist:Linux_32bit path: "*Linux_32bit.tar.gz" name: Linux_X86-32 - - task: Linux_64bit + - task: dist:Linux_64bit path: "*Linux_64bit.tar.gz" name: Linux_X86-64 - - task: Linux_ARMv6 + - task: dist:Linux_ARMv6 path: "*Linux_ARMv6.tar.gz" name: Linux_ARMv6 - - task: Linux_ARMv7 + - task: dist:Linux_ARMv7 path: "*Linux_ARMv7.tar.gz" name: Linux_ARMv7 - - task: Linux_ARM64 + - task: dist:Linux_ARM64 path: "*Linux_ARM64.tar.gz" name: Linux_ARM64 - - task: macOS_64bit + - task: dist:macOS_64bit path: "*macOS_64bit.tar.gz" name: macOS_64 - - task: macOS_ARM64 + - task: dist:macOS_ARM64 path: "*macOS_ARM64.tar.gz" name: macOS_ARM64 + - task: protoc:collect + path: "*_proto.zip" + name: rpc-protocol-files steps: - name: Checkout repository @@ -123,48 +126,18 @@ jobs: run: | PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }} export PACKAGE_NAME_PREFIX - task dist:${{ matrix.os.task }} + task ${{ matrix.artifact.task }} # Transfer builds to artifacts job - name: Upload build artifact uses: actions/upload-artifact@v3 with: - path: ${{ env.DIST_DIR }}/${{ matrix.os.path }} - name: ${{ matrix.os.name }} - - proto-files: - needs: - - package-name-prefix - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x - - - name: Collect proto files - run: | - PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }} - export PACKAGE_NAME_PREFIX - task protoc:collect - - - name: Upload proto files zip - uses: actions/upload-artifact@v3 - with: - path: ${{ env.DIST_DIR }}/*.zip - name: rpc-protocol-files + path: ${{ env.DIST_DIR }}/${{ matrix.artifact.path }} + name: ${{ matrix.artifact.name }} checksums: needs: - build - - proto-files - package-name-prefix runs-on: ubuntu-latest From a8bd158a75c69f8844b460fbed1c5e3690605514 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Tue, 25 Oct 2022 11:41:56 +0200 Subject: [PATCH 8/8] Fix Publish Tester Build job dependencies --- .github/workflows/publish-go-tester-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index d14bfbe2a9a..05195742573 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -137,7 +137,7 @@ jobs: checksums: needs: - - build + - create-artifacts - package-name-prefix runs-on: ubuntu-latest