From dee539097f4d60615bea1ed736edbe841815f4ef Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 7 Mar 2023 00:02:11 -0800 Subject: [PATCH 1/3] Reduce line length to <=120 in YAML files where feasible 120 columns is the recommended line length for YAML code in Arduino tooling projects. The yamllint tool used by the "Check YAML" template produces a warning when a line exceeds this length. This is not a hard limit and in some cases it is either impossible or not beneficial to make lines less than 120 in length so some violations of the guideline are unavoidable. However, a survey of the YAML files in the repository revealed some opportunities for improving the code by reducing the lengths. --- .../deploy-cobra-mkdocs-versioned-poetry.yml | 15 +++++++++++++-- .github/workflows/generate-index.yml | 7 ++++++- .../workflows/release-go-crosscompile-task.yml | 3 ++- Taskfile.yml | 15 +++++++++++---- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml b/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml index c17004df..73764d12 100644 --- a/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml +++ b/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml @@ -36,7 +36,13 @@ jobs: id: determination run: | RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" - if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then + if [[ + "${{ github.event_name }}" == "push" || + ( + "${{ github.event_name }}" == "create" && + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX + ) + ]]; then RESULT="true" else RESULT="false" @@ -85,7 +91,12 @@ jobs: # Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits. git config --global user.email "bot@arduino.cc" git config --global user.name "ArduinoBot" - git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages + git fetch \ + --no-tags \ + --prune \ + --depth=1 \ + origin \ + +refs/heads/gh-pages:refs/remotes/origin/gh-pages poetry run mike deploy \ --update-aliases \ --push \ diff --git a/.github/workflows/generate-index.yml b/.github/workflows/generate-index.yml index 0fd39d00..671373c7 100644 --- a/.github/workflows/generate-index.yml +++ b/.github/workflows/generate-index.yml @@ -70,7 +70,12 @@ jobs: # disable gpg pass prompt # https://stackoverflow.com/questions/49072403/suppress-the-passphrase-prompt-in-gpg-command - name: sign the json - run: gpg --pinentry-mode=loopback --passphrase "${{ secrets.PASSPHRASE }}" --output boards/module_firmware_index.json.sig --detach-sign boards/module_firmware_index.json + run: | + gpg \ + --pinentry-mode=loopback \ + --passphrase "${{ secrets.PASSPHRASE }}" \ + --output boards/module_firmware_index.json.sig \ + --detach-sign boards/module_firmware_index.json - name: create the gzip run: gzip --keep boards/module_firmware_index.json diff --git a/.github/workflows/release-go-crosscompile-task.yml b/.github/workflows/release-go-crosscompile-task.yml index 7abf1eba..a92a5d9f 100644 --- a/.github/workflows/release-go-crosscompile-task.yml +++ b/.github/workflows/release-go-crosscompile-task.yml @@ -89,7 +89,8 @@ jobs: env: KEYCHAIN: "sign.keychain" INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12" - KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret + # Arbitrary password for a keychain that exists only for the duration of the job, so not secret + KEYCHAIN_PASSWORD: keychainpassword run: | echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}" security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" diff --git a/Taskfile.yml b/Taskfile.yml index 498f71aa..e56c6ac2 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -29,7 +29,8 @@ tasks: echo "Licensed does not have Windows support." echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact." else - echo "licensed not found or not in PATH. Please install: https://github.com/github/licensed#as-an-executable" + echo "licensed not found or not in PATH." + echo "Please install: https://github.com/github/licensed#as-an-executable" fi exit 1 fi @@ -85,7 +86,8 @@ tasks: # npx --call uses the native shell, which makes it too difficult to use npx for this application on Windows, # so the Windows user is required to have markdown-link-check installed and in PATH. if ! which markdown-link-check &>/dev/null; then - echo "markdown-link-check not found or not in PATH. Please install: https://github.com/tcort/markdown-link-check#readme" + echo "markdown-link-check not found or not in PATH." + echo "Please install: https://github.com/tcort/markdown-link-check#readme" exit 1 fi # Default behavior of the task on Windows is to exit the task when the first broken link causes a non-zero @@ -190,7 +192,8 @@ tasks: cmds: - | if ! which ec &>/dev/null; then - echo "ec not found or not in PATH. Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation" + echo "ec not found or not in PATH." + echo "Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation" exit 1 fi - ec @@ -240,7 +243,11 @@ vars: DEFAULT_GO_MODULE_PATH: ./ DEFAULT_GO_PACKAGES: sh: | - echo $(cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"') + echo $( + cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && + go list ./... | tr '\n' ' ' || + echo '"ERROR: Unable to discover Go packages"' + ) # build vars COMMIT: sh: echo "$(git log --no-show-signature -n 1 --format=%h)" From e309eeed2a84cad46018747cd4f30084dad78daf Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 7 Mar 2023 00:10:27 -0800 Subject: [PATCH 2/3] Migrate workflows from deprecated set-output commands GitHub Actions provides the capability for workflow authors to use the capabilities of the GitHub Actions ToolKit package directly in the `run` keys of workflows via "workflow commands". One such command is `set-output`, which allows data to be passed out of a workflow step as an output. It has been determined that this command has potential to be a security risk in some applications. For this reason, GitHub has deprecated the command and a warning of this is shown in the workflow run summary page of any workflow using it: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ The identical capability is now provided in a safer form via the GitHub Actions "environment files" system. Migrating the use of the deprecated workflow commands to use the `GITHUB_OUTPUT` environment file instead fixes any potential vulnerabilities in the workflows, resolves the warnings, and avoids the eventual complete breakage of the workflows that would result from GitHub's planned removal of the `set-output` workflow command 2023-05-31. --- .github/workflows/check-go-dependencies-task.yml | 2 +- .github/workflows/check-notarization-certificates.yml | 2 +- .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml | 4 ++-- .github/workflows/publish-go-tester-task.yml | 2 +- .github/workflows/release-go-crosscompile-task.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- .github/workflows/test-go-integration-task.yml | 2 +- .github/workflows/test-go-task.yml | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index f23e816f..380ab85b 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -56,7 +56,7 @@ jobs: RESULT="false" fi - echo "::set-output name=result::$RESULT" + echo "result=$RESULT" >> $GITHUB_OUTPUT check-cache: needs: run-determination diff --git a/.github/workflows/check-notarization-certificates.yml b/.github/workflows/check-notarization-certificates.yml index 74b35564..e5b1382e 100644 --- a/.github/workflows/check-notarization-certificates.yml +++ b/.github/workflows/check-notarization-certificates.yml @@ -108,7 +108,7 @@ jobs: echo "Certificate expiration date: $EXPIRATION_DATE" echo "Days remaining before expiration: $DAYS_BEFORE_EXPIRATION" - echo "::set-output name=days::$DAYS_BEFORE_EXPIRATION" + echo "days=$DAYS_BEFORE_EXPIRATION" >> $GITHUB_OUTPUT - name: Check if expiration notification period has been reached id: check-expiration diff --git a/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml b/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml index 73764d12..2e6a526c 100644 --- a/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml +++ b/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml @@ -48,7 +48,7 @@ jobs: RESULT="false" fi - echo "::set-output name=result::$RESULT" + echo "result=$RESULT" >> $GITHUB_OUTPUT publish: runs-on: ubuntu-latest @@ -83,7 +83,7 @@ jobs: - name: Determine versioning parameters id: determine-versioning - run: echo "::set-output name=data::$(poetry run python docs/siteversion/siteversion.py)" + run: echo "data=$(poetry run python docs/siteversion/siteversion.py)" >> $GITHUB_OUTPUT - name: Publish documentation if: fromJson(steps.determine-versioning.outputs.data).version != null diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index d5f0a656..c656478f 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -52,7 +52,7 @@ jobs: RESULT="false" fi - echo "::set-output name=result::$RESULT" + echo "result=$RESULT" >> $GITHUB_OUTPUT build: needs: run-determination diff --git a/.github/workflows/release-go-crosscompile-task.yml b/.github/workflows/release-go-crosscompile-task.yml index a92a5d9f..c59cf3c5 100644 --- a/.github/workflows/release-go-crosscompile-task.yml +++ b/.github/workflows/release-go-crosscompile-task.yml @@ -210,7 +210,7 @@ jobs: run: | wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip unzip -p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver >/tmp/semver && chmod +x /tmp/semver - if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "::set-output name=IS_PRE::true"; fi + if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi - name: Create Github Release and upload artifacts uses: ncipollo/release-action@v1 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 70085bde..6f9c91a9 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -103,7 +103,7 @@ jobs: run: | # Use of this flag in the github-label-sync command will cause it to only check the validity of the # configuration. - echo "::set-output name=flag::--dry-run" + echo "flag=--dry-run" >> $GITHUB_OUTPUT - name: Checkout repository uses: actions/checkout@v3 diff --git a/.github/workflows/test-go-integration-task.yml b/.github/workflows/test-go-integration-task.yml index 519b3ebd..08b52839 100644 --- a/.github/workflows/test-go-integration-task.yml +++ b/.github/workflows/test-go-integration-task.yml @@ -55,7 +55,7 @@ jobs: RESULT="false" fi - echo "::set-output name=result::$RESULT" + echo "result=$RESULT" >> $GITHUB_OUTPUT test: needs: run-determination diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml index 8c5fdfa7..6f9c000f 100644 --- a/.github/workflows/test-go-task.yml +++ b/.github/workflows/test-go-task.yml @@ -51,7 +51,7 @@ jobs: RESULT="false" fi - echo "::set-output name=result::$RESULT" + echo "result=$RESULT" >> $GITHUB_OUTPUT test: name: test (${{ matrix.module.path }} - ${{ matrix.operating-system }}) From 636d337c64b3ee5c5faa61d67761b880cb790111 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 7 Mar 2023 00:13:08 -0800 Subject: [PATCH 3/3] Build releases simultaneously Introducing the use of a matrix greatly improves time performances during the build making process, since each build task is performed simultaneously. To support this, a check has been added to avoid creating the same changelog more than once. The calculation of the checksums has also been modified. Previously, it was done three (3) times at different stages of the workflow. This is pointless, since the only checksums that matter are the ones calculated when the files are in their final form. For this reason, it is now only done once during the release creation. --- .github/workflows/publish-go-tester-task.yml | 138 ++++++++++-------- .../release-go-crosscompile-task.yml | 44 +++--- DistTasks.yml | 25 ---- 3 files changed, 104 insertions(+), 103 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index c656478f..441cf442 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -26,9 +26,10 @@ on: env: # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax GO_VERSION: "1.18" + # As defined by the Taskfile's PROJECT_NAME variable + PROJECT_NAME: arduino-fwuploader # As defined by the Taskfile's DIST_DIR variable DIST_DIR: dist - BUILDS_ARTIFACT: build-artifacts jobs: run-determination: @@ -40,10 +41,12 @@ jobs: id: determination run: | RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + TAG_REGEX="refs/tags/.*" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ - "${{ github.event_name }}" != "create" || - "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX + ("${{ github.event_name }}" != "create" || + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX) && + ! "${{ github.ref }}" =~ $TAG_REGEX ]]; then # Run the other jobs. RESULT="true" @@ -54,10 +57,59 @@ jobs: echo "result=$RESULT" >> $GITHUB_OUTPUT - build: + package-name-prefix: needs: run-determination if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest + outputs: + prefix: ${{ steps.calculation.outputs.prefix }} + steps: + - name: package name prefix calculation + id: calculation + run: | + PACKAGE_NAME_PREFIX="test" + if [ "${{ github.event_name }}" = "pull_request" ]; then + PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}" + fi + PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-" + + echo "prefix=$PACKAGE_NAME_PREFIX" >> $GITHUB_OUTPUT + + build: + needs: package-name-prefix + name: Build ${{ matrix.os.name }} + runs-on: ubuntu-latest + + strategy: + matrix: + os: + - task: Windows_32bit + path: "*Windows_32bit.zip" + name: Windows_X86-32 + - task: Windows_64bit + path: "*Windows_64bit.zip" + name: Windows_X86-64 + - task: Linux_32bit + path: "*Linux_32bit.tar.gz" + name: Linux_X86-32 + - task: Linux_64bit + path: "*Linux_64bit.tar.gz" + name: Linux_X86-64 + - task: Linux_ARMv6 + path: "*Linux_ARMv6.tar.gz" + name: Linux_ARMv6 + - task: Linux_ARMv7 + path: "*Linux_ARMv7.tar.gz" + name: Linux_ARMv7 + - task: Linux_ARM64 + path: "*Linux_ARM64.tar.gz" + name: Linux_ARM64 + - task: macOS_64bit + path: "*macOS_64bit.tar.gz" + name: macOS_64 + - task: macOS_ARM64 + path: "*macOS_ARM64.tar.gz" + name: macOS_ARM64 steps: - name: Checkout repository @@ -76,69 +128,41 @@ jobs: - name: Build run: | - PACKAGE_NAME_PREFIX="test" - if [ "${{ github.event_name }}" = "pull_request" ]; then - PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}" - fi - PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-" + PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }} export PACKAGE_NAME_PREFIX - task dist:all + task dist:${{ matrix.os.task }} # Transfer builds to artifacts job - - name: Upload combined builds artifact + - name: Upload build artifact uses: actions/upload-artifact@v3 with: - path: ${{ env.DIST_DIR }} - name: ${{ env.BUILDS_ARTIFACT }} + path: ${{ env.DIST_DIR }}/${{ matrix.os.path }} + name: ${{ matrix.os.name }} - artifacts: - name: ${{ matrix.artifact.name }} artifact - needs: build + checksums: + needs: + - build + - package-name-prefix runs-on: ubuntu-latest - strategy: - matrix: - artifact: - - path: "*checksums.txt" - name: checksums - - path: "*Linux_32bit.tar.gz" - name: Linux_X86-32 - - path: "*Linux_64bit.tar.gz" - name: Linux_X86-64 - - path: "*Linux_ARM64.tar.gz" - name: Linux_ARM64 - - path: "*Linux_ARMv6.tar.gz" - name: Linux_ARMv6 - - path: "*Linux_ARMv7.tar.gz" - name: Linux_ARMv7 - - path: "*macOS_64bit.tar.gz" - name: macOS_64 - - path: "*macOS_ARM64.tar.gz" - name: macOS_ARM64 - - path: "*Windows_32bit.zip" - name: Windows_X86-32 - - path: "*Windows_64bit.zip" - name: Windows_X86-64 - steps: - - name: Download combined builds artifact + - name: Download build artifacts uses: actions/download-artifact@v3 - with: - name: ${{ env.BUILDS_ARTIFACT }} - path: ${{ env.BUILDS_ARTIFACT }} - - name: Upload individual build artifact + - name: Create checksum file + 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: ${{ env.BUILDS_ARTIFACT }}/${{ matrix.artifact.path }} - name: ${{ matrix.artifact.name }} - - clean: - needs: artifacts - runs-on: ubuntu-latest - - steps: - - name: Remove unneeded combined builds artifact - uses: geekyeggo/delete-artifact@v2 - with: - name: ${{ env.BUILDS_ARTIFACT }} + path: ./*checksums.txt + name: checksums diff --git a/.github/workflows/release-go-crosscompile-task.yml b/.github/workflows/release-go-crosscompile-task.yml index c59cf3c5..8e8a5bd3 100644 --- a/.github/workflows/release-go-crosscompile-task.yml +++ b/.github/workflows/release-go-crosscompile-task.yml @@ -21,6 +21,19 @@ jobs: create-release-artifacts: runs-on: ubuntu-latest + strategy: + matrix: + os: + - Windows_32bit + - Windows_64bit + - Linux_32bit + - Linux_64bit + - Linux_ARMv6 + - Linux_ARMv7 + - Linux_ARM64 + - macOS_64bit + - macOS_ARM64 + steps: - name: Checkout repository uses: actions/checkout@v3 @@ -28,6 +41,8 @@ jobs: fetch-depth: 0 - name: Create changelog + # Avoid creating the same changelog for each os + if: matrix.os == 'Windows_32bit' uses: arduino/create-changelog@v1 with: tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$' @@ -47,7 +62,7 @@ jobs: version: 3.x - name: Build - run: task dist:all + run: task dist:${{ matrix.os }} - name: Upload artifacts uses: actions/upload-artifact@v3 @@ -60,9 +75,6 @@ jobs: name: Notarize ${{ matrix.artifact.name }} runs-on: macos-latest needs: create-release-artifacts - outputs: - checksum-darwin_amd64: ${{ steps.re-package.outputs.checksum-darwin_amd64 }} - checksum-darwin_arm64: ${{ steps.re-package.outputs.checksum-darwin_arm64 }} env: GON_CONFIG_PATH: gon.config.hcl @@ -140,14 +152,10 @@ jobs: run: | gon "${{ env.GON_CONFIG_PATH }}" - - name: Re-package binary and output checksum + - name: Re-package binary id: re-package working-directory: ${{ env.DIST_DIR }} - # This step performs the following: - # 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file) - # 2. Recalculate package checksum - # 3. Output the new checksum to include in the nnnnnn-checksums.txt file - # (it cannot be done there because of workflow job parallelization) + # Repackage the signed binary replaced in place by Gon (ignoring the output zip file) run: | # 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. @@ -157,11 +165,9 @@ jobs: tar -czvf "$PACKAGE_FILENAME" \ -C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \ -C ../../ LICENSE.txt - CHECKSUM_LINE="$(shasum -a 256 $PACKAGE_FILENAME)" echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV - echo "::set-output name=checksum-${{ matrix.artifact.name }}::$CHECKSUM_LINE" - - name: Upload artifacts + - name: Upload artifact uses: actions/upload-artifact@v3 with: if-no-files-found: error @@ -193,15 +199,11 @@ jobs: # would be calculated since the binary is modified during notarization run: task dist:generate-index-data - - name: Update checksum + - name: Create checksum file + working-directory: ${{ env.DIST_DIR}} run: | - declare -a checksum_lines=("${{ needs.notarize-macos.outputs.checksum-darwin_amd64 }}" "${{ needs.notarize-macos.outputs.checksum-darwin_arm64 }}") - for checksum_line in "${checksum_lines[@]}" - do - CHECKSUM=$(echo ${checksum_line} | cut -d " " -f 1) - PACKAGE_FILENAME=$(echo ${checksum_line} | cut -d " " -f 2) - perl -pi -w -e "s/.*${PACKAGE_FILENAME}/${CHECKSUM} ${PACKAGE_FILENAME}/g;" ${{ env.DIST_DIR }}/*-checksums.txt - done + TAG="${GITHUB_REF/refs\/tags\//}" + sha256sum ${{ env.PROJECT_NAME }}_${TAG}* > ${TAG}-checksums.txt - name: Identify Prerelease # This is a workaround while waiting for create-release action diff --git a/DistTasks.yml b/DistTasks.yml index c5d8fa49..6ff0dc81 100644 --- a/DistTasks.yml +++ b/DistTasks.yml @@ -17,23 +17,7 @@ version: "3" # # The project MUST contain a LICENSE.txt file in the root folder or packaging will fail. -vars: - CHECKSUM_FILE: "{{.VERSION}}-checksums.txt" - tasks: - all: - desc: Build for distribution for all platforms - cmds: - - task: Windows_32bit - - task: Windows_64bit - - task: Linux_32bit - - task: Linux_64bit - - task: Linux_ARMv6 - - task: Linux_ARMv7 - - task: Linux_ARM64 - - task: macOS_64bit - - task: macOS_ARM64 - Windows_32bit: desc: Builds Windows 32 bit binaries env: @@ -45,7 +29,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe {{.LDFLAGS}} cd {{.DIST_DIR}} zip {{.PACKAGE_NAME}} {{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe ../LICENSE.txt -j - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_windows_386" PACKAGE_PLATFORM: "Windows_32bit" @@ -61,7 +44,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe {{.LDFLAGS}} cd {{.DIST_DIR}} zip {{.PACKAGE_NAME}} {{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe ../LICENSE.txt -j - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_windows_amd64" PACKAGE_PLATFORM: "Windows_64bit" @@ -78,7 +60,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} cd {{.DIST_DIR}} tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_amd32" PACKAGE_PLATFORM: "Linux_32bit" @@ -94,7 +75,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} cd {{.DIST_DIR}} tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_amd64" PACKAGE_PLATFORM: "Linux_64bit" @@ -111,7 +91,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} cd {{.DIST_DIR}} tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_7" PACKAGE_PLATFORM: "Linux_ARMv7" @@ -128,7 +107,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} cd {{.DIST_DIR}} tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_6" PACKAGE_PLATFORM: "Linux_ARMv6" @@ -144,7 +122,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} cd {{.DIST_DIR}} tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_64" PACKAGE_PLATFORM: "Linux_ARM64" @@ -160,7 +137,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} cd {{.DIST_DIR}} tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_amd64" PACKAGE_PLATFORM: "macOS_64bit" @@ -176,7 +152,6 @@ tasks: go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} cd {{.DIST_DIR}} tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} - sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_arm64" PACKAGE_PLATFORM: "macOS_ARM64"