From 6d584adc235b210fbf6342942b90a486f818a2e5 Mon Sep 17 00:00:00 2001 From: Matteo Pologruto Date: Wed, 16 Nov 2022 15:30:57 +0100 Subject: [PATCH 1/5] Add version package to later use as configuration package --- globals/globals.go | 13 +++++++++++++ main.go | 7 +++---- version/version.go | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 globals/globals.go create mode 100644 version/version.go diff --git a/globals/globals.go b/globals/globals.go new file mode 100644 index 0000000..a5d2bce --- /dev/null +++ b/globals/globals.go @@ -0,0 +1,13 @@ +package globals + +import ( + "os" + "path/filepath" + + "github.com/arduino/arduinoOTA/version" +) + +var ( + // VersionInfo contains all info injected during build + VersionInfo = version.NewInfo(filepath.Base(os.Args[0])) +) diff --git a/main.go b/main.go index c716195..6455435 100644 --- a/main.go +++ b/main.go @@ -15,10 +15,9 @@ import ( "strconv" "strings" "time" -) -// AppVersion is the application version. -const AppVersion = "1.3.0" + "github.com/arduino/arduinoOTA/globals" +) var compileInfo string @@ -45,7 +44,7 @@ func main() { flag.Parse() if *version { - fmt.Println(AppVersion + compileInfo) + fmt.Println(globals.VersionInfo.String() + compileInfo) os.Exit(0) } diff --git a/version/version.go b/version/version.go new file mode 100644 index 0000000..3f7261e --- /dev/null +++ b/version/version.go @@ -0,0 +1,39 @@ +package version + +import "fmt" + +var ( + defaultVersionString = "0.0.0-git" + versionString = "" + commit = "" + date = "" +) + +// Info is a struct that contains information about the application +type Info struct { + Application string `json:"Application"` + VersionString string `json:"VersionString"` + Commit string `json:"Commit"` + Date string `json:"Date"` +} + +// NewInfo returns a pointer to an updated Info struct +func NewInfo(application string) *Info { + return &Info{ + Application: application, + VersionString: versionString, + Commit: commit, + Date: date, + } +} + +func (i *Info) String() string { + return fmt.Sprintf("%[1]s Version: %[2]s Commit: %[3]s Date: %[4]s", i.Application, i.VersionString, i.Commit, i.Date) +} + +//nolint:gochecknoinits +func init() { + if versionString == "" { + versionString = defaultVersionString + } +} From 7490907e4a10c2178f25b8092e4479f75256db86 Mon Sep 17 00:00:00 2001 From: Matteo Pologruto Date: Wed, 16 Nov 2022 16:06:34 +0100 Subject: [PATCH 2/5] Add CI workflow to publish releases On every push of a tag named with a version format: - Build the project for all supported platforms. - Sign and notarize the macOS builds. - Create a GitHub release. - Builds and checksums are attached as release assets - A changelog generated from the commit history is added to the release description - If the tag has a pre-release version suffix, the GitHub release will be marked as a pre-release. - Upload the builds to Arduino's downloads server. --- .../release-go-crosscompile-task.yml | 219 ++++++++++++++++++ DistTasks.yml | 183 +++++++++++++++ README.md | 1 + Taskfile.yml | 24 ++ 4 files changed, 427 insertions(+) create mode 100644 .github/workflows/release-go-crosscompile-task.yml create mode 100644 DistTasks.yml diff --git a/.github/workflows/release-go-crosscompile-task.yml b/.github/workflows/release-go-crosscompile-task.yml new file mode 100644 index 0000000..9b7c3ce --- /dev/null +++ b/.github/workflows/release-go-crosscompile-task.yml @@ -0,0 +1,219 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/release-go-crosscompile-task.md +name: Release + +env: + # As defined by the Taskfile's PROJECT_NAME variable + PROJECT_NAME: arduinoOTA + # As defined by the Taskfile's DIST_DIR variable + DIST_DIR: dist + # The project's folder on Arduino's download server for uploading builds + AWS_PLUGIN_TARGET: /arduinoOTA/ + ARTIFACT_NAME: dist + # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax + GO_VERSION: "1.17" + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+*" + +jobs: + create-release-artifacts: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Create changelog + uses: arduino/create-changelog@v1 + with: + tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$' + filter-regex: '^\[(skip|changelog)[ ,-](skip|changelog)\].*' + case-insensitive-regex: true + changelog-file-path: "${{ env.DIST_DIR }}/CHANGELOG.md" + + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Build + run: task dist:all + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: ${{ env.ARTIFACT_NAME }} + path: ${{ env.DIST_DIR }} + + notarize-macos: + 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 + + strategy: + matrix: + artifact: + - name: darwin_amd64 + path: "macOS_64bit.tar.gz" + - name: darwin_arm64 + path: "macOS_ARM64.tar.gz" + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: ${{ env.ARTIFACT_NAME }} + path: ${{ env.DIST_DIR }} + + - name: Import Code-Signing Certificates + 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 + run: | + echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}" + security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" + security default-keychain -s "${{ env.KEYCHAIN }}" + security unlock-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" + security import \ + "${{ env.INSTALLER_CERT_MAC_PATH }}" \ + -k "${{ env.KEYCHAIN }}" \ + -f pkcs12 \ + -A \ + -T "/usr/bin/codesign" \ + -P "${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}" + security set-key-partition-list \ + -S apple-tool:,apple: \ + -s \ + -k "${{ env.KEYCHAIN_PASSWORD }}" \ + "${{ env.KEYCHAIN }}" + + - name: Install gon for code signing and app notarization + run: | + wget -q https://github.com/mitchellh/gon/releases/download/v0.2.3/gon_macos.zip + unzip gon_macos.zip -d /usr/local/bin + + - name: Write gon config to file + # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) + run: | + cat > "${{ env.GON_CONFIG_PATH }}" <> $GITHUB_ENV + echo "checksum-${{ matrix.artifact.name }}=$CHECKSUM_LINE" >> $GITHUB_OUTPUT + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: ${{ env.ARTIFACT_NAME }} + path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }} + + create-release: + runs-on: ubuntu-latest + needs: notarize-macos + + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: ${{ env.ARTIFACT_NAME }} + path: ${{ env.DIST_DIR }} + + - name: Update checksum + 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 + + - name: Identify Prerelease + # This is a workaround while waiting for create-release action + # to implement auto pre-release based on tag + id: prerelease + 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 "IS_PRE=true" >> $GITHUB_OUTPUT; fi + + - name: Create Github Release and upload artifacts + uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + bodyFile: ${{ env.DIST_DIR }}/CHANGELOG.md + draft: false + prerelease: ${{ steps.prerelease.outputs.IS_PRE }} + # NOTE: "Artifact is a directory" warnings are expected and don't indicate a problem + # (all the files we need are in the DIST_DIR root) + artifacts: ${{ env.DIST_DIR }}/* + + - name: Upload release files on Arduino downloads servers + uses: docker://plugins/s3 + env: + PLUGIN_SOURCE: "${{ env.DIST_DIR }}/*" + PLUGIN_TARGET: ${{ env.AWS_PLUGIN_TARGET }} + PLUGIN_STRIP_PREFIX: "${{ env.DIST_DIR }}/" + PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/DistTasks.yml b/DistTasks.yml new file mode 100644 index 0000000..51e3575 --- /dev/null +++ b/DistTasks.yml @@ -0,0 +1,183 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-crosscompile-task/DistTasks.yml +version: "3" + +# This taskfile is ideally meant to be project agnostic and could be dropped in +# on other Go projects with minimal or no changes. +# +# To use it simply add the following lines to your main taskfile: +# includes: +# dist: ./DistTasks.yml +# +# The following variables must be declared in the including taskfile for the +# build process to work correctly: +# * DIST_DIR: the folder that will contain the final binaries and packages +# * PROJECT_NAME: the name of the project, used in package name +# * VERSION: the version of the project, used in package name and checksum file +# * LD_FLAGS: flags used at build time +# +# 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: + GOOS: "windows" + GOARCH: "386" + GO386: "softfloat" + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.zip" + + Windows_64bit: + desc: Builds Windows 64 bit binaries + env: + GOOS: "windows" + GOARCH: "amd64" + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.zip" + + Linux_32bit: + desc: Builds Linux 32 bit binaries + env: + GOOS: "linux" + GOARCH: "386" + GO386: "softfloat" + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" + + Linux_64bit: + desc: Builds Linux 64 bit binaries + env: + GOOS: "linux" + GOARCH: "amd64" + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" + + Linux_ARMv7: + desc: Builds Linux ARMv7 binaries + env: + GOOS: "linux" + GOARCH: "arm" + GOARM: 7 + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" + + Linux_ARMv6: + desc: Builds Linux ARMv6 binaries + env: + GOOS: "linux" + GOARCH: "arm" + GOARM: 6 + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" + + Linux_ARM64: + desc: Builds Linux ARM64 binaries + env: + GOOS: "linux" + GOARCH: "arm64" + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" + + macOS_64bit: + desc: Builds Mac OS X 64 bit binaries + env: + GOOS: "darwin" + GOARCH: "amd64" + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" + + macOS_ARM64: + desc: Builds Mac OS X ARM64 binaries + env: + GOOS: "darwin" + GOARCH: "arm64" + cmds: + - | + 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" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" diff --git a/README.md b/README.md index c9f8a6a..bdf25bf 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ [![Check YAML status](https://github.com/arduino/arduinoOTA/actions/workflows/check-yaml-task.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/check-yaml-task.yml) [![Check License status](https://github.com/arduino/arduinoOTA/actions/workflows/check-license.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/check-license.yml) [![Sync Labels status](https://github.com/arduino/arduinoOTA/actions/workflows/sync-labels-npm.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/sync-labels-npm.yml) +[![Release status](https://github.com/arduino/arduinoOTA/actions/workflows/release-go-crosscompile-task.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/release-go-crosscompile-task.yml) **arduinoOTA** is a tool for uploading programs to [Arduino](https://arduino.cc/) boards over a network. diff --git a/Taskfile.yml b/Taskfile.yml index ce06a8d..daf7b18 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,7 +1,31 @@ # See: https://taskfile.dev/#/usage version: "3" +includes: + dist: ./DistTasks.yml + vars: + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml + PROJECT_NAME: "arduinoOTA" + DIST_DIR: "dist" + # build vars + COMMIT: + sh: echo "$(git log --no-show-signature -n 1 --format=%h)" + TIMESTAMP: + sh: echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" + TIMESTAMP_SHORT: + sh: echo "{{now | date "20060102"}}" + TAG: + sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1)" + VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}git-snapshot{{end}}" + CONFIGURATION_PACKAGE: "github.com/arduino/arduinoOTA/version" + LDFLAGS: >- + -ldflags + ' + -X {{.CONFIGURATION_PACKAGE}}.versionString={{.VERSION}} + -X {{.CONFIGURATION_PACKAGE}}.commit={{.COMMIT}} + -X {{.CONFIGURATION_PACKAGE}}.date={{.TIMESTAMP}} + ' # Path of the project's primary Go module: DEFAULT_GO_MODULE_PATH: ./ DEFAULT_GO_PACKAGES: From b4a59f5e5077c9e3425125202fe84e3f03587757 Mon Sep 17 00:00:00 2001 From: Matteo Pologruto Date: Thu, 17 Nov 2022 10:39:23 +0100 Subject: [PATCH 3/5] Update release workflow using parallelization 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. --- .../release-go-crosscompile-task.yml | 41 +++++++++++-------- DistTasks.yml | 25 ----------- 2 files changed, 23 insertions(+), 43 deletions(-) diff --git a/.github/workflows/release-go-crosscompile-task.yml b/.github/workflows/release-go-crosscompile-task.yml index 9b7c3ce..5af7509 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 @@ -139,14 +154,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. @@ -156,11 +167,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 "checksum-${{ matrix.artifact.name }}=$CHECKSUM_LINE" >> $GITHUB_OUTPUT - - name: Upload artifacts + - name: Upload artifact uses: actions/upload-artifact@v3 with: if-no-files-found: error @@ -178,15 +187,11 @@ jobs: name: ${{ env.ARTIFACT_NAME }} path: ${{ env.DIST_DIR }} - - 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 51e3575..9274993 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" From f44422b483b2c854470dcf31d960c4d98eb35eff Mon Sep 17 00:00:00 2001 From: Matteo Pologruto Date: Thu, 17 Nov 2022 12:21:21 +0100 Subject: [PATCH 4/5] Remove deploy.sh and check-shell-task workflow --- .editorconfig | 60 --------- .github/workflows/check-shell-task.yml | 177 ------------------------- README.md | 1 - Taskfile.yml | 75 ----------- deploy.sh | 46 ------- 5 files changed, 359 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .github/workflows/check-shell-task.yml delete mode 100755 deploy.sh diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index eda8544..0000000 --- a/.editorconfig +++ /dev/null @@ -1,60 +0,0 @@ -# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/general/.editorconfig -# See: https://editorconfig.org/ -# The formatting style defined in this file is the official standardized style to be used in all Arduino Tooling -# projects and should not be modified. -# Note: indent style for each file type is defined even when it matches the universal config in order to make it clear -# that this type has an official style. - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 2 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true - -[*.{adoc,asc,asciidoc}] -indent_size = 2 -indent_style = space - -[*.{bash,sh}] -indent_size = 2 -indent_style = space - -[*.{c,cc,cp,cpp,cxx,h,hh,hpp,hxx,ii,inl,ino,ixx,pde,tpl,tpp,txx}] -indent_size = 2 -indent_style = space - -[*.{go,mod}] -indent_style = tab - -[*.java] -indent_size = 2 -indent_style = space - -[*.{js,jsx,json,jsonc,json5,ts,tsx}] -indent_size = 2 -indent_style = space - -[*.{md,mdx,mkdn,mdown,markdown}] -indent_size = unset -indent_style = space - -[*.proto] -indent_size = 2 -indent_style = space - -[*.py] -indent_size = 4 -indent_style = space - -[*.svg] -indent_size = 2 -indent_style = space - -[*.{yaml,yml}] -indent_size = 2 -indent_style = space - -[{.gitconfig,.gitmodules}] -indent_style = tab diff --git a/.github/workflows/check-shell-task.yml b/.github/workflows/check-shell-task.yml deleted file mode 100644 index f6cd3bd..0000000 --- a/.github/workflows/check-shell-task.yml +++ /dev/null @@ -1,177 +0,0 @@ -# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-shell-task.md -name: Check Shell Scripts - -# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows -on: - create: - push: - paths: - - ".github/workflows/check-shell-task.ya?ml" - - "Taskfile.ya?ml" - - "**/.editorconfig" - - "**.bash" - - "**.sh" - pull_request: - paths: - - ".github/workflows/check-shell-task.ya?ml" - - "Taskfile.ya?ml" - - "**/.editorconfig" - - "**.bash" - - "**.sh" - schedule: - # Run every Tuesday at 8 AM UTC to catch breakage caused by tool changes. - - cron: "0 8 * * TUE" - workflow_dispatch: - repository_dispatch: - -jobs: - run-determination: - runs-on: ubuntu-latest - outputs: - result: ${{ steps.determination.outputs.result }} - steps: - - name: Determine if the rest of the workflow should run - id: determination - run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" - # 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 - ]]; then - # Run the other jobs. - RESULT="true" - else - # There is no need to run the other jobs. - RESULT="false" - fi - - echo "::set-output name=result::$RESULT" - - lint: - name: ${{ matrix.configuration.name }} - needs: run-determination - if: needs.run-determination.outputs.result == 'true' - runs-on: ubuntu-latest - - env: - # See: https://github.com/koalaman/shellcheck/releases/latest - SHELLCHECK_RELEASE_ASSET_SUFFIX: .linux.x86_64.tar.xz - - strategy: - fail-fast: false - - matrix: - configuration: - - name: Generate problem matcher output - # ShellCheck's "gcc" output format is required for annotated diffs, but inferior for humans reading the log. - format: gcc - # The other matrix job is used to set the result, so this job is configured to always pass. - continue-on-error: true - - name: ShellCheck - # ShellCheck's "tty" output format is most suitable for humans reading the log. - format: tty - continue-on-error: false - - steps: - - name: Set environment variables - run: | - # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable - echo "INSTALL_PATH=${{ runner.temp }}/shellcheck" >> "$GITHUB_ENV" - - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x - - - name: Download latest ShellCheck release binary package - id: download - uses: MrOctopus/download-asset-action@1.0 - with: - repository: koalaman/shellcheck - excludes: prerelease, draft - asset: ${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }} - target: ${{ env.INSTALL_PATH }} - - - name: Install ShellCheck - run: | - cd "${{ env.INSTALL_PATH }}" - tar --extract --file="${{ steps.download.outputs.name }}" - EXTRACTION_FOLDER="$(basename "${{ steps.download.outputs.name }}" "${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}")" - # Add installation to PATH: - # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path - echo "${{ env.INSTALL_PATH }}/$EXTRACTION_FOLDER" >> "$GITHUB_PATH" - - - name: Run ShellCheck - uses: liskin/gh-problem-matcher-wrap@v1 - continue-on-error: ${{ matrix.configuration.continue-on-error }} - with: - linters: gcc - run: task --silent shell:check SHELLCHECK_FORMAT=${{ matrix.configuration.format }} - - formatting: - needs: run-determination - if: needs.run-determination.outputs.result == 'true' - runs-on: ubuntu-latest - - steps: - - name: Set environment variables - run: | - # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable - echo "SHFMT_INSTALL_PATH=${{ runner.temp }}/shfmt" >> "$GITHUB_ENV" - - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x - - - name: Download shfmt - id: download - uses: MrOctopus/download-asset-action@1.0 - with: - repository: mvdan/sh - excludes: prerelease, draft - asset: _linux_amd64 - target: ${{ env.SHFMT_INSTALL_PATH }} - - - name: Install shfmt - run: | - # Executable permissions of release assets are lost - chmod +x "${{ env.SHFMT_INSTALL_PATH }}/${{ steps.download.outputs.name }}" - # Standardize binary name - mv "${{ env.SHFMT_INSTALL_PATH }}/${{ steps.download.outputs.name }}" "${{ env.SHFMT_INSTALL_PATH }}/shfmt" - # Add installation to PATH: - # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path - echo "${{ env.SHFMT_INSTALL_PATH }}" >> "$GITHUB_PATH" - - - name: Format shell scripts - run: task --silent shell:format - - - name: Check formatting - run: git diff --color --exit-code - - executable: - needs: run-determination - if: needs.run-determination.outputs.result == 'true' - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x - - - name: Check for non-executable scripts - run: task --silent shell:check-mode diff --git a/README.md b/README.md index bdf25bf..06bd938 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ [![Check Prettier Formatting status](https://github.com/arduino/arduinoOTA/actions/workflows/check-prettier-formatting-task.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/check-prettier-formatting-task.yml) [![Spell Check status](https://github.com/arduino/arduinoOTA/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/spell-check-task.yml) [![Check Markdown status](https://github.com/arduino/arduinoOTA/actions/workflows/check-markdown-task.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/check-markdown-task.yml) -[![Check Shell Scripts status](https://github.com/arduino/arduinoOTA/actions/workflows/check-shell-task.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/check-shell-task.yml) [![Check Taskfiles status](https://github.com/arduino/arduinoOTA/actions/workflows/check-taskfiles.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/check-taskfiles.yml) [![Check Workflows status](https://github.com/arduino/arduinoOTA/actions/workflows/check-workflows-task.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/check-workflows-task.yml) [![Check YAML status](https://github.com/arduino/arduinoOTA/actions/workflows/check-yaml-task.yml/badge.svg)](https://github.com/arduino/arduinoOTA/actions/workflows/check-yaml-task.yml) diff --git a/Taskfile.yml b/Taskfile.yml index daf7b18..46c41f2 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -307,81 +307,6 @@ tasks: cmds: - poetry install --no-root - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml - shell:check: - desc: Check for problems with shell scripts - cmds: - - | - if ! which shellcheck &>/dev/null; then - echo "shellcheck not installed or not in PATH. Please install: https://github.com/koalaman/shellcheck#installing" - exit 1 - fi - - | - # There is something odd about shellcheck that causes the task to always exit on the first fail, despite any - # measures that would prevent this with any other command. So it's necessary to call shellcheck only once with - # the list of script paths as an argument. This could lead to exceeding the maximum command length on Windows if - # the repository contained a large number of scripts, but it's unlikely to happen in reality. - shellcheck \ - --format={{default "tty" .SHELLCHECK_FORMAT}} \ - $( - # The odd method for escaping . in the regex is required for windows compatibility because mvdan.cc/sh gives - # \ characters special treatment on Windows in an attempt to support them as path separators. - find . \ - -type d -name '.git' -prune -or \ - -type d -name '.licenses' -prune -or \ - -type d -name '__pycache__' -prune -or \ - -type d -name 'node_modules' -prune -or \ - \( \ - -regextype posix-extended \ - -regex '.*[.](bash|sh)' -and \ - -type f \ - \) \ - -print - ) - - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml - shell:check-mode: - desc: Check for non-executable shell scripts - cmds: - - | - EXIT_STATUS=0 - while read -r nonExecutableScriptPath; do - # The while loop always runs once, even if no file was found - if [[ "$nonExecutableScriptPath" == "" ]]; then - continue - fi - - echo "::error file=${nonExecutableScriptPath}::non-executable script file: $nonExecutableScriptPath"; - EXIT_STATUS=1 - done <<<"$( - # The odd approach to escaping `.` in the regex is required for windows compatibility because mvdan.cc/sh - # gives `\` characters special treatment on Windows in an attempt to support them as path separators. - find . \ - -type d -name '.git' -prune -or \ - -type d -name '.licenses' -prune -or \ - -type d -name '__pycache__' -prune -or \ - -type d -name 'node_modules' -prune -or \ - \( \ - -regextype posix-extended \ - -regex '.*[.](bash|sh)' -and \ - -type f -and \ - -not -executable \ - -print \ - \) - )" - exit $EXIT_STATUS - - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml - shell:format: - desc: Format shell script files - cmds: - - | - if ! which shfmt &>/dev/null; then - echo "shfmt not installed or not in PATH. Please install: https://github.com/mvdan/sh#shfmt" - exit 1 - fi - - shfmt -w . - # Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml utility:mktemp-file: diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 1d8518e..0000000 --- a/deploy.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -xe -GIT_REV="$(git log --pretty=format:'%h' -n 1)" -BUILD_DATE="$(date +%Y-%m-%d:%H:%M:%S)" -COMPILEINFO="$(echo "+${GIT_REV}+${BUILD_DATE}" | tr -d '"')" - -VERSION="$(grep "const AppVersion" main.go | cut -f4 -d " " | tr -d '"')" - -#Remember to set GOROOT accordingly with your installation - -export GOPATH=$PWD -export CGO_ENABLED=false - -rm -rf distrib/ - -declare -a target_folders=("linux_amd64" "linux_386" "linux_arm" "darwin_amd64" "windows_386" "linux_arm64") - -mkdir distrib - -for folder in "${target_folders[@]}"; do - - IFS=_ read -r -a fields <<<"$folder" - mkdir -p "distrib/${folder}/bin/" - GOOS="${fields[0]}" GOARCH="${fields[1]}" go build -o "distrib/${folder}/bin/arduinoOTA" -ldflags "-X main.compileInfo=$COMPILEINFO" main.go -done - -#Fix windows binary extension -mv distrib/windows_386/bin/arduinoOTA distrib/windows_386/bin/arduinoOTA.exe - -cd distrib - -for folder in "${target_folders[@]}"; do - mv "$folder" arduinoOTA - if [[ $folder == "windows_386" ]]; then - zip -r "arduinoOTA-${VERSION}-${folder}.zip" arduinoOTA/ - else - tar cjf "arduinoOTA-${VERSION}-${folder}.tar.bz2" arduinoOTA/ - fi - rm -rf arduinoOTA -done - -echo ======= -ls -la arduinoOTA* -echo ======= -sha256sum arduinoOTA* -echo ======= -shasum arduinoOTA* From e3c4d7ea2109bcaa2b5d4e4730dbda2cea254fc5 Mon Sep 17 00:00:00 2001 From: Matteo Pologruto Date: Fri, 18 Nov 2022 10:27:51 +0100 Subject: [PATCH 5/5] Add DistTasks.yml to check-taskfiles workflow --- .github/workflows/check-taskfiles.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check-taskfiles.yml b/.github/workflows/check-taskfiles.yml index e1b2903..79412b8 100644 --- a/.github/workflows/check-taskfiles.yml +++ b/.github/workflows/check-taskfiles.yml @@ -13,12 +13,14 @@ on: - "package.json" - "package-lock.json" - "**/Taskfile.ya?ml" + - "**/DistTasks.ya?ml" pull_request: paths: - ".github/workflows/check-taskfiles.ya?ml" - "package.json" - "package-lock.json" - "**/Taskfile.ya?ml" + - "**/DistTasks.ya?ml" schedule: # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema. - cron: "0 8 * * TUE" @@ -37,6 +39,7 @@ jobs: file: # TODO: add paths to any additional Taskfiles here - ./**/Taskfile.yml + - ./**/DistTasks.yml steps: - name: Checkout repository