├── .gitignore ├── package.json ├── .markdownlintignore ├── .markdown-link-check.json ├── README.md ├── gon.config.hcl ├── .github ├── workflows │ ├── check-workflows-task.yml │ ├── check-markdown-task.yml │ ├── sync-labels.yml │ └── release.yml └── ISSUE_TEMPLATE │ └── bug-report.yml ├── .markdownlint.yml ├── package_index.template ├── patches └── 0001-Add-extra-version-information-to-avrdude-output.patch └── Taskfile.yml /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "ajv-cli": "^5.0.0", 4 | "ajv-formats": "^2.1.1", 5 | "markdown-link-check": "^3.10.2", 6 | "markdownlint-cli": "^0.32.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.markdownlintignore: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown/.markdownlintignore 2 | .licenses/ 3 | __pycache__/ 4 | node_modules/ 5 | -------------------------------------------------------------------------------- /.markdown-link-check.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpHeaders": [ 3 | { 4 | "urls": ["https://docs.github.com/"], 5 | "headers": { 6 | "Accept-Encoding": "gzip, deflate, br" 7 | } 8 | } 9 | ], 10 | "retryOn429": true, 11 | "retryCount": 3, 12 | "aliveStatusCodes": [200, 206] 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # avrdude-packing 2 | 3 | [![Check Markdown status](https://github.com/arduino/avrdude-packing/actions/workflows/check-markdown-task.yml/badge.svg)](https://github.com/arduino/avrdude-packing/actions/workflows/check-markdown-task.yml) 4 | [![Check Workflows status](https://github.com/arduino/avrdude-packing/actions/workflows/check-workflows-task.yml/badge.svg)](https://github.com/arduino/avrdude-packing/actions/workflows/check-workflows-task.yml) 5 | 6 | This repository contains the release pipeline to build statically avrdude 7 | -------------------------------------------------------------------------------- /gon.config.hcl: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/general/gon.config.hcl 2 | # See: https://github.com/Bearer/gon#configuration-file 3 | source = ["dist/avrdude_macOS_64bit/bin/avrdude"] 4 | bundle_id = "cc.arduino.avrdude" 5 | 6 | sign { 7 | application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)" 8 | } 9 | 10 | # Ask Gon for zip output to force notarization process to take place. 11 | # The CI will ignore the zip output, using the signed binary only. 12 | zip { 13 | output_path = "unused.zip" 14 | } -------------------------------------------------------------------------------- /.github/workflows/check-workflows-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-workflows-task.md 2 | name: Check Workflows 3 | 4 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 9 | on: 10 | push: 11 | paths: 12 | - ".github/workflows/*.ya?ml" 13 | - "package.json" 14 | - "package-lock.json" 15 | - "Taskfile.ya?ml" 16 | pull_request: 17 | paths: 18 | - ".github/workflows/*.ya?ml" 19 | - "package.json" 20 | - "package-lock.json" 21 | - "Taskfile.ya?ml" 22 | schedule: 23 | # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema. 24 | - cron: "0 8 * * TUE" 25 | workflow_dispatch: 26 | repository_dispatch: 27 | 28 | jobs: 29 | validate: 30 | runs-on: ubuntu-latest 31 | permissions: 32 | contents: read 33 | 34 | steps: 35 | - name: Checkout repository 36 | uses: actions/checkout@v4 37 | 38 | - name: Setup Node.js 39 | uses: actions/setup-node@v4 40 | with: 41 | node-version: ${{ env.NODE_VERSION }} 42 | 43 | - name: Install Task 44 | uses: arduino/setup-task@v2 45 | with: 46 | repo-token: ${{ secrets.GITHUB_TOKEN }} 47 | version: 3.x 48 | 49 | - name: Validate workflows 50 | run: task --silent ci:validate -------------------------------------------------------------------------------- /.markdownlint.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown/.markdownlint.yml 2 | # See: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md 3 | # The code style defined in this file is the official standardized style to be used in all Arduino projects and should 4 | # not be modified. 5 | # Note: Rules disabled solely because they are redundant to Prettier are marked with a "Prettier" comment. 6 | 7 | default: false 8 | MD001: false 9 | MD002: false 10 | MD003: false # Prettier 11 | MD004: false # Prettier 12 | MD005: false # Prettier 13 | MD006: false # Prettier 14 | MD007: false # Prettier 15 | MD008: false # Prettier 16 | MD009: 17 | br_spaces: 0 18 | strict: true 19 | list_item_empty_lines: false # Prettier 20 | MD010: false # Prettier 21 | MD011: true 22 | MD012: false # Prettier 23 | MD013: false 24 | MD014: false 25 | MD018: true 26 | MD019: false # Prettier 27 | MD020: true 28 | MD021: false # Prettier 29 | MD022: false # Prettier 30 | MD023: false # Prettier 31 | MD024: false 32 | MD025: 33 | level: 1 34 | front_matter_title: '^\s*"?title"?\s*[:=]' 35 | MD026: false 36 | MD027: false # Prettier 37 | MD028: false 38 | MD029: 39 | style: one 40 | MD030: 41 | ul_single: 1 42 | ol_single: 1 43 | ul_multi: 1 44 | ol_multi: 1 45 | MD031: false # Prettier 46 | MD032: false # Prettier 47 | MD033: false 48 | MD034: false 49 | MD035: false # Prettier 50 | MD036: false 51 | MD037: true 52 | MD038: true 53 | MD039: true 54 | MD040: false 55 | MD041: false 56 | MD042: true 57 | MD043: false 58 | MD044: false 59 | MD045: true 60 | MD046: 61 | style: fenced 62 | MD047: false # Prettier 63 | -------------------------------------------------------------------------------- /package_index.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "avrdude", 3 | "version": "%%VERSION%%", 4 | "systems": [ 5 | { 6 | "host": "x86_64-apple-darwin12", 7 | "url": "https://downloads.arduino.cc/tools/%%FILENAME_MACOS_64BIT%%", 8 | "archiveFileName": "%%FILENAME_MACOS_64BIT%%", 9 | "size": "%%SIZE_MACOS_64BIT%%", 10 | "checksum": "SHA-256:%%SHA_MACOS_64BIT%%" 11 | }, 12 | { 13 | "host": "arm-linux-gnueabihf", 14 | "url": "https://downloads.arduino.cc/tools/%%FILENAME_LINUX_ARMV6%%", 15 | "archiveFileName": "%%FILENAME_LINUX_ARMV6%%", 16 | "size": "%%SIZE_LINUX_ARMV6%%", 17 | "checksum": "SHA-256:%%SHA_LINUX_ARMV6%%" 18 | }, 19 | { 20 | "host": "aarch64-linux-gnu", 21 | "url": "https://downloads.arduino.cc/tools/%%FILENAME_LINUX_ARM64%%", 22 | "archiveFileName": "%%FILENAME_LINUX_ARM64%%", 23 | "size": "%%SIZE_LINUX_ARM64%%", 24 | "checksum": "SHA-256:%%SHA_LINUX_ARM64%%" 25 | }, 26 | { 27 | "host": "x86_64-linux-gnu", 28 | "url": "https://downloads.arduino.cc/tools/%%FILENAME_LINUX_64BIT%%", 29 | "archiveFileName": "%%FILENAME_LINUX_64BIT%%", 30 | "size": "%%SIZE_LINUX_64BIT%%", 31 | "checksum": "SHA-256:%%SHA_LINUX_64BIT%%" 32 | }, 33 | { 34 | "host": "i686-linux-gnu", 35 | "url": "https://downloads.arduino.cc/tools/%%FILENAME_LINUX_32BIT%%", 36 | "archiveFileName": "%%FILENAME_LINUX_32BIT%%", 37 | "size": "%%SIZE_LINUX_32BIT%%", 38 | "checksum": "SHA-256:%%SHA_LINUX_32BIT%%" 39 | }, 40 | { 41 | "host": "i686-mingw32", 42 | "url": "https://downloads.arduino.cc/tools/%%FILENAME_WINDOWS_32BIT%%", 43 | "archiveFileName": "%%FILENAME_WINDOWS_32BIT%%", 44 | "size": "%%SIZE_WINDOWS_32BIT%%", 45 | "checksum": "SHA-256:%%SHA_WINDOWS_32BIT%%" 46 | } 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/bug-report.yml 2 | # See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms 3 | 4 | name: Bug report 5 | description: Report a problem with the code or documentation in this repository. 6 | labels: 7 | - "type: imperfection" 8 | body: 9 | - type: textarea 10 | id: description 11 | attributes: 12 | label: Describe the problem 13 | validations: 14 | required: true 15 | - type: textarea 16 | id: reproduce 17 | attributes: 18 | label: To reproduce 19 | description: Provide the specific set of steps we can follow to reproduce the problem. 20 | validations: 21 | required: true 22 | - type: textarea 23 | id: expected 24 | attributes: 25 | label: Expected behavior 26 | description: What would you expect to happen after following those instructions? 27 | validations: 28 | required: true 29 | - type: input 30 | id: project-version 31 | attributes: 32 | label: avrdude version 33 | description: | 34 | Which version of avrdude are you using? 35 | _This should be the most recent version available._ 36 | validations: 37 | required: true 38 | - type: dropdown 39 | id: os 40 | attributes: 41 | label: Operating system 42 | description: Which operating system(s) are you using on your computer? 43 | multiple: true 44 | options: 45 | - Windows 46 | - Linux 47 | - macOS 48 | - N/A 49 | validations: 50 | required: true 51 | - type: input 52 | id: os-version 53 | attributes: 54 | label: Operating system version 55 | description: Which version of the operating system are you using on your computer? 56 | validations: 57 | required: true 58 | - type: textarea 59 | id: additional 60 | attributes: 61 | label: Additional context 62 | description: Add any additional information here. 63 | validations: 64 | required: false 65 | - type: checkboxes 66 | id: checklist 67 | attributes: 68 | label: Issue checklist 69 | description: Please double-check that you have done each of the following things before submitting the issue. 70 | options: 71 | - label: I searched for previous reports in [the issue tracker](https://github.com/arduino/avrdude-packing/issues?q=) 72 | required: true 73 | - label: I verified the problem still occurs when using the latest version 74 | required: true 75 | - label: My report contains all necessary details 76 | required: true 77 | -------------------------------------------------------------------------------- /patches/0001-Add-extra-version-information-to-avrdude-output.patch: -------------------------------------------------------------------------------- 1 | From a52d8145bcd94310d2f737cb56e15d25d9eba86f Mon Sep 17 00:00:00 2001 2 | From: Hans Ulrich Niedermann 3 | Date: Tue, 8 Oct 2024 21:21:00 +0200 4 | Subject: [PATCH] Add extra version information to avrdude output 5 | 6 | Some downstream projects build avrdude and want to add 7 | their own version information to the avrdude version. 8 | 9 | This adds a clean way to do that without patching for both 10 | cmake and automake based builds: 11 | 12 | cmake -DEXTRA_VERSION:STRING=-arduino.1-rc1 13 | ../configure EXTRA_VERSION=-arduino.1-rc1 14 | 15 | After building avrdude, the last line of "avrdude -?" 16 | will now look similar to the following, depending on 17 | whether you are building an avrdude git checkout or 18 | an avrdude release: 19 | 20 | avrdude version 8.0-20240901-arduino.1-rc1 (30e19f23), https://github.com/avrdudes/avrdude 21 | avrdude version 8.1-arduino.1-rc1 (30e19f23), https://github.com/avrdudes/avrdude 22 | --- 23 | CMakeLists.txt | 5 +++-- 24 | src/configure.ac | 5 +++-- 25 | 2 files changed, 6 insertions(+), 4 deletions(-) 26 | 27 | diff --git a/CMakeLists.txt b/CMakeLists.txt 28 | index 67e38493..b40e5689 100644 29 | --- a/CMakeLists.txt 30 | +++ b/CMakeLists.txt 31 | @@ -49,7 +49,7 @@ include(FindPackageMessage) 32 | include(GNUInstallDirs) 33 | 34 | set(CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}") 35 | -set(AVRDUDE_FULL_VERSION ${CMAKE_PROJECT_VERSION}) 36 | +set(AVRDUDE_FULL_VERSION "${CMAKE_PROJECT_VERSION}${EXTRA_VERSION}") 37 | 38 | # ===================================== 39 | # Get Git commit info 40 | @@ -91,7 +91,7 @@ if(Git_FOUND) 41 | 42 | # If the commit is not tagged, include the date and commit hash in the full version string. 43 | if(NOT GIT_COMMIT_HASH STREQUAL GIT_TAG_HASH) 44 | - set(AVRDUDE_FULL_VERSION "${CMAKE_PROJECT_VERSION}-${GIT_COMMIT_DATE} (${GIT_COMMIT_HASH})") 45 | + set(AVRDUDE_FULL_VERSION "${CMAKE_PROJECT_VERSION}-${GIT_COMMIT_DATE}${EXTRA_VERSION} (${GIT_COMMIT_HASH})") 46 | endif() 47 | endif() 48 | 49 | @@ -374,6 +374,7 @@ if (DEBUG_CMAKE) 50 | message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}") 51 | message(STATUS "CONFIG_DIR: ${CONFIG_DIR}") 52 | message(STATUS "AVRDUDE_FULL_VERSION: ${AVRDUDE_FULL_VERSION}") 53 | + message(STATUS "EXTRA_VERSION: ${EXTRA_VERSION}") 54 | message(STATUS "USE_EXTERNAL_LIBS: ${USE_EXTERNAL_LIBS}") 55 | message(STATUS "USE_LIBUSBWIN32: ${USE_LIBUSBWIN32}") 56 | message(STATUS "HAVE_LIBELF: ${HAVE_LIBELF}") 57 | diff --git a/src/configure.ac b/src/configure.ac 58 | index 91f6a445..c294f590 100644 59 | --- a/src/configure.ac 60 | +++ b/src/configure.ac 61 | @@ -80,11 +80,12 @@ AC_MSG_RESULT([$PACKAGE_VERSION]) 62 | dnl Compose the full version message mirroring the cmake one, inform 63 | dnl about it and pass it on to avrdude.conf and the "avrdude -?" 64 | dnl version message 65 | +AC_ARG_VAR([EXTRA_VERSION], [extra version information to be added to version info]) 66 | AC_MSG_CHECKING([versioninfo derived AVRDUDE_FULL_VERSION]) 67 | if test "x$GIT_COMMIT_HASH" = "x$GIT_TAG_HASH"; then 68 | - AVRDUDE_FULL_VERSION="$PACKAGE_VERSION" 69 | + AVRDUDE_FULL_VERSION="$PACKAGE_VERSION$EXTRA_VERSION" 70 | else 71 | - AVRDUDE_FULL_VERSION="$PACKAGE_VERSION ($GIT_COMMIT_HASH)" 72 | + AVRDUDE_FULL_VERSION="$PACKAGE_VERSION$EXTRA_VERSION ($GIT_COMMIT_HASH)" 73 | fi 74 | AC_MSG_RESULT([$AVRDUDE_FULL_VERSION]) 75 | AC_DEFINE_UNQUOTED([AVRDUDE_FULL_VERSION], ["$AVRDUDE_FULL_VERSION"], 76 | -- 77 | 2.46.2 78 | -------------------------------------------------------------------------------- /.github/workflows/check-markdown-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-markdown-task.md 2 | name: Check Markdown 3 | 4 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 9 | on: 10 | create: 11 | push: 12 | paths: 13 | - ".github/workflows/check-markdown-task.ya?ml" 14 | - ".markdown-link-check.json" 15 | - "package.json" 16 | - "package-lock.json" 17 | - "Taskfile.ya?ml" 18 | - "**/.markdownlint*" 19 | - "**.mdx?" 20 | - "**.mkdn" 21 | - "**.mdown" 22 | - "**.markdown" 23 | pull_request: 24 | paths: 25 | - ".github/workflows/check-markdown-task.ya?ml" 26 | - ".markdown-link-check.json" 27 | - "package.json" 28 | - "package-lock.json" 29 | - "Taskfile.ya?ml" 30 | - "**/.markdownlint*" 31 | - "**.mdx?" 32 | - "**.mkdn" 33 | - "**.mdown" 34 | - "**.markdown" 35 | schedule: 36 | # Run every Tuesday at 8 AM UTC to catch breakage caused by external changes. 37 | - cron: "0 8 * * TUE" 38 | workflow_dispatch: 39 | repository_dispatch: 40 | 41 | jobs: 42 | run-determination: 43 | runs-on: ubuntu-latest 44 | permissions: {} 45 | outputs: 46 | result: ${{ steps.determination.outputs.result }} 47 | steps: 48 | - name: Determine if the rest of the workflow should run 49 | id: determination 50 | run: | 51 | RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" 52 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 53 | if [[ 54 | "${{ github.event_name }}" != "create" || 55 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 56 | ]]; then 57 | # Run the other jobs. 58 | RESULT="true" 59 | else 60 | # There is no need to run the other jobs. 61 | RESULT="false" 62 | fi 63 | 64 | echo "result=$RESULT" >> $GITHUB_OUTPUT 65 | 66 | lint: 67 | needs: run-determination 68 | if: needs.run-determination.outputs.result == 'true' 69 | runs-on: ubuntu-latest 70 | permissions: 71 | contents: read 72 | 73 | steps: 74 | - name: Checkout repository 75 | uses: actions/checkout@v4 76 | 77 | - name: Setup Node.js 78 | uses: actions/setup-node@v4 79 | with: 80 | node-version: ${{ env.NODE_VERSION }} 81 | 82 | - name: Initialize markdownlint-cli problem matcher 83 | uses: xt0rted/markdownlint-problem-matcher@v3 84 | 85 | - name: Install Task 86 | uses: arduino/setup-task@v2 87 | with: 88 | repo-token: ${{ secrets.GITHUB_TOKEN }} 89 | version: 3.x 90 | 91 | - name: Lint 92 | run: task markdown:lint 93 | 94 | links: 95 | needs: run-determination 96 | if: needs.run-determination.outputs.result == 'true' 97 | runs-on: ubuntu-latest 98 | permissions: 99 | contents: read 100 | 101 | steps: 102 | - name: Checkout repository 103 | uses: actions/checkout@v4 104 | 105 | - name: Setup Node.js 106 | uses: actions/setup-node@v4 107 | with: 108 | node-version: ${{ env.NODE_VERSION }} 109 | 110 | - name: Install Task 111 | uses: arduino/setup-task@v2 112 | with: 113 | repo-token: ${{ secrets.GITHUB_TOKEN }} 114 | version: 3.x 115 | 116 | - name: Check links 117 | run: task --silent markdown:check-links -------------------------------------------------------------------------------- /.github/workflows/sync-labels.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md 2 | name: Sync Labels 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | push: 7 | paths: 8 | - ".github/workflows/sync-labels.ya?ml" 9 | - ".github/label-configuration-files/*.ya?ml" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/sync-labels.ya?ml" 13 | - ".github/label-configuration-files/*.ya?ml" 14 | schedule: 15 | # Run daily at 8 AM UTC to sync with changes to shared label configurations. 16 | - cron: "0 8 * * *" 17 | workflow_dispatch: 18 | repository_dispatch: 19 | 20 | env: 21 | CONFIGURATIONS_FOLDER: .github/label-configuration-files 22 | CONFIGURATIONS_ARTIFACT: label-configuration-files 23 | 24 | jobs: 25 | check: 26 | runs-on: ubuntu-latest 27 | permissions: 28 | contents: read 29 | 30 | steps: 31 | - name: Checkout repository 32 | uses: actions/checkout@v4 33 | 34 | - name: Download JSON schema for labels configuration file 35 | id: download-schema 36 | uses: carlosperate/download-file-action@v2 37 | with: 38 | file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json 39 | location: ${{ runner.temp }}/label-configuration-schema 40 | 41 | - name: Install JSON schema validator 42 | run: | 43 | sudo npm install \ 44 | --global \ 45 | ajv-cli \ 46 | ajv-formats 47 | 48 | - name: Validate local labels configuration 49 | run: | 50 | # See: https://github.com/ajv-validator/ajv-cli#readme 51 | ajv validate \ 52 | --all-errors \ 53 | -c ajv-formats \ 54 | -s "${{ steps.download-schema.outputs.file-path }}" \ 55 | -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" 56 | 57 | download: 58 | needs: check 59 | runs-on: ubuntu-latest 60 | permissions: {} 61 | 62 | strategy: 63 | matrix: 64 | filename: 65 | # Filenames of the shared configurations to apply to the repository in addition to the local configuration. 66 | # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels 67 | - universal.yml 68 | - tooling.yml 69 | 70 | 71 | steps: 72 | - name: Download 73 | uses: carlosperate/download-file-action@v2 74 | with: 75 | file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} 76 | 77 | - name: Pass configuration files to next job via workflow artifact 78 | uses: actions/upload-artifact@v4 79 | with: 80 | path: | 81 | *.yaml 82 | *.yml 83 | if-no-files-found: error 84 | name: ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }} 85 | 86 | sync: 87 | needs: download 88 | runs-on: ubuntu-latest 89 | permissions: 90 | contents: read 91 | issues: write 92 | 93 | steps: 94 | - name: Set environment variables 95 | run: | 96 | # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable 97 | echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" 98 | 99 | - name: Determine whether to dry run 100 | id: dry-run 101 | if: > 102 | github.event_name == 'pull_request' || 103 | ( 104 | ( 105 | github.event_name == 'push' || 106 | github.event_name == 'workflow_dispatch' 107 | ) && 108 | github.ref != format('refs/heads/{0}', github.event.repository.default_branch) 109 | ) 110 | run: | 111 | # Use of this flag in the github-label-sync command will cause it to only check the validity of the 112 | # configuration. 113 | echo "flag=--dry-run" >> $GITHUB_OUTPUT 114 | 115 | - name: Checkout repository 116 | uses: actions/checkout@v4 117 | 118 | - name: Download configuration files artifact 119 | uses: actions/download-artifact@v4 120 | with: 121 | pattern: ${{ env.CONFIGURATIONS_ARTIFACT }}-* 122 | merge-multiple: true 123 | path: ${{ env.CONFIGURATIONS_FOLDER }} 124 | 125 | - name: Remove unneeded artifact 126 | uses: geekyeggo/delete-artifact@v5 127 | with: 128 | name: ${{ env.CONFIGURATIONS_ARTIFACT }}-* 129 | 130 | - name: Merge label configuration files 131 | run: | 132 | # Merge all configuration files 133 | shopt -s extglob 134 | cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" 135 | 136 | - name: Install github-label-sync 137 | run: sudo npm install --global github-label-sync 138 | 139 | - name: Sync labels 140 | env: 141 | GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} 142 | run: | 143 | # See: https://github.com/Financial-Times/github-label-sync 144 | github-label-sync \ 145 | --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ 146 | ${{ steps.dry-run.outputs.flag }} \ 147 | ${{ github.repository }} -------------------------------------------------------------------------------- /Taskfile.yml: -------------------------------------------------------------------------------- 1 | # See: https://taskfile.dev/#/usage 2 | version: "3" 3 | 4 | tasks: 5 | docs:generate: 6 | desc: Create all generated documentation content 7 | 8 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml 9 | markdown:check-links: 10 | desc: Check for broken links 11 | deps: 12 | - task: docs:generate 13 | - task: npm:install-deps 14 | cmds: 15 | - | 16 | if [[ "{{.OS}}" == "Windows_NT" ]]; then 17 | # npx --call uses the native shell, which makes it too difficult to use npx for this application on Windows, 18 | # so the Windows user is required to have markdown-link-check installed and in PATH. 19 | if ! which markdown-link-check &>/dev/null; then 20 | echo "markdown-link-check not found or not in PATH. Please install: https://github.com/tcort/markdown-link-check#readme" 21 | exit 1 22 | fi 23 | # Default behavior of the task on Windows is to exit the task when the first broken link causes a non-zero 24 | # exit status, but it's better to check all links before exiting. 25 | set +o errexit 26 | STATUS=0 27 | # Using -regex instead of -name to avoid Task's behavior of globbing even when quoted on Windows 28 | # The odd method for escaping . in the regex is required for windows compatibility because mvdan.cc/sh gives 29 | # \ characters special treatment on Windows in an attempt to support them as path separators. 30 | for file in $( 31 | find . \ 32 | -type d -name '.git' -prune -o \ 33 | -type d -name '.licenses' -prune -o \ 34 | -type d -name '__pycache__' -prune -o \ 35 | -type d -name 'node_modules' -prune -o \ 36 | -regex ".*[.]md" -print 37 | ); do 38 | markdown-link-check \ 39 | --quiet \ 40 | --config "./.markdown-link-check.json" \ 41 | "$file" 42 | STATUS=$(( $STATUS + $? )) 43 | done 44 | exit $STATUS 45 | else 46 | npx --package=markdown-link-check --call=' 47 | STATUS=0 48 | for file in $( 49 | find . \ 50 | -type d -name '.git' -prune -o \ 51 | -type d -name '.licenses' -prune -o \ 52 | -type d -name '__pycache__' -prune -o \ 53 | -type d -name 'node_modules' -prune -o \ 54 | -regex ".*[.]md" -print 55 | ); do 56 | markdown-link-check \ 57 | --quiet \ 58 | --config "./.markdown-link-check.json" \ 59 | "$file" 60 | STATUS=$(( $STATUS + $? )) 61 | done 62 | exit $STATUS 63 | ' 64 | fi 65 | 66 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml 67 | markdown:fix: 68 | desc: Automatically correct linting violations in Markdown files where possible 69 | deps: 70 | - task: npm:install-deps 71 | cmds: 72 | - npx markdownlint-cli --fix "**/*.md" 73 | 74 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml 75 | markdown:lint: 76 | desc: Check for problems in Markdown files 77 | deps: 78 | - task: npm:install-deps 79 | cmds: 80 | - npx markdownlint-cli "**/*.md" 81 | 82 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml 83 | npm:install-deps: 84 | desc: Install dependencies managed by npm 85 | cmds: 86 | - npm install 87 | 88 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml 89 | ci:validate: 90 | desc: Validate GitHub Actions workflows against their JSON schema 91 | vars: 92 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json 93 | WORKFLOW_SCHEMA_URL: https://json.schemastore.org/github-workflow 94 | WORKFLOW_SCHEMA_PATH: 95 | sh: task utility:mktemp-file TEMPLATE="workflow-schema-XXXXXXXXXX.json" 96 | WORKFLOWS_DATA_PATH: "./.github/workflows/*.{yml,yaml}" 97 | deps: 98 | - task: npm:install-deps 99 | cmds: 100 | - | 101 | wget \ 102 | --quiet \ 103 | --output-document="{{.WORKFLOW_SCHEMA_PATH}}" \ 104 | {{.WORKFLOW_SCHEMA_URL}} 105 | - | 106 | npx \ 107 | --package=ajv-cli \ 108 | --package=ajv-formats \ 109 | ajv validate \ 110 | --all-errors \ 111 | --strict=false \ 112 | -c ajv-formats \ 113 | -s "{{.WORKFLOW_SCHEMA_PATH}}" \ 114 | -d "{{.WORKFLOWS_DATA_PATH}}" 115 | 116 | # Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout 117 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml 118 | utility:mktemp-file: 119 | vars: 120 | RAW_PATH: 121 | sh: mktemp --tmpdir "{{.TEMPLATE}}" 122 | cmds: 123 | - task: utility:normalize-path 124 | vars: 125 | RAW_PATH: "{{.RAW_PATH}}" 126 | 127 | # Make a temporary folder named according to the passed TEMPLATE variable and print the path passed to stdout 128 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml 129 | utility:mktemp-folder: 130 | vars: 131 | RAW_PATH: 132 | sh: mktemp --directory --tmpdir "{{.TEMPLATE}}" 133 | cmds: 134 | - task: utility:normalize-path 135 | vars: 136 | RAW_PATH: "{{.RAW_PATH}}" 137 | 138 | # Print a normalized version of the path passed via the RAW_PATH variable to stdout 139 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml 140 | utility:normalize-path: 141 | cmds: 142 | - | 143 | if [[ "{{.OS}}" == "Windows_NT" ]] && which cygpath &>/dev/null; then 144 | # Even though the shell handles POSIX format absolute paths as expected, external applications do not. 145 | # So paths passed to such applications must first be converted to Windows format. 146 | cygpath -w "{{.RAW_PATH}}" 147 | else 148 | echo "{{.RAW_PATH}}" 149 | fi -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | env: 4 | # The name of the project 5 | PROJECT_NAME: avrdude 6 | DIST_DIR: dist 7 | ARTIFACT_NAME: dist 8 | # The project's folder on Arduino's download server for uploading builds 9 | AWS_PLUGIN_TARGET: /tools/ 10 | 11 | on: 12 | push: 13 | tags: 14 | - "[0-9]+.[0-9]+*" 15 | 16 | jobs: 17 | build: 18 | name: build (${{ matrix.config.os }}, ${{ matrix.config.arch }}) 19 | runs-on: 20 | ubuntu-latest 21 | permissions: 22 | contents: read 23 | strategy: 24 | matrix: 25 | config: 26 | - os: Linux 27 | arch: 64bit 28 | cross_compile: x86_64-ubuntu16.04-linux-gnu 29 | - os: Linux 30 | arch: 32bit 31 | cross_compile: i686-ubuntu16.04-linux-gnu 32 | - os: Linux 33 | arch: ARMv6 34 | cross_compile: arm-linux-gnueabihf 35 | - os: Linux 36 | arch: ARM64 37 | cross_compile: aarch64-linux-gnu 38 | - os: macOS 39 | arch: 64bit 40 | cross_compile: x86_64-apple-darwin13 41 | cross_compiler: o64-clang 42 | ar: /opt/osxcross/target/bin/x86_64-apple-darwin13-ar # we have to manually specify the full path otherwise it's not found for some reason 43 | ld: /opt/osxcross/target/bin/x86_64-apple-darwin13-ld 44 | - os: Windows 45 | arch: 32bit 46 | cross_compile: i686-w64-mingw32 47 | extension: .exe 48 | 49 | container: 50 | image: ghcr.io/arduino/crossbuild:0.2.2 51 | 52 | steps: 53 | # the tag must be formatted this way -arduino., e.g tag -> 7.0-arduino.1 54 | - name: Set Avrdude tag name 55 | id: get_tag_name 56 | run: | 57 | TAG="${GITHUB_REF##*/}" 58 | echo "AVRDUDE_TAG=v${TAG%%-*}" >> $GITHUB_OUTPUT 59 | echo "ARDUINO_TAG=-${TAG#*-}" >> $GITHUB_OUTPUT 60 | 61 | # this repo should contain only the patches that could not be upstreamed and the release CI nothing else 62 | - name: Checkout avrdude-packing repository 63 | uses: actions/checkout@v4 64 | with: 65 | path: avrdude-packing 66 | 67 | - name: Checkout avrdude repository 68 | uses: actions/checkout@v4 69 | with: 70 | repository: avrdudes/avrdude 71 | ref: ${{ steps.get_tag_name.outputs.AVRDUDE_TAG }} # pay attention, the pathches could need updating 72 | path: ${{ env.PROJECT_NAME }} 73 | 74 | - name: Apply patches 75 | working-directory: ${{ env.PROJECT_NAME }} 76 | run: git apply -v ../avrdude-packing/patches/*.patch 77 | 78 | - name: replace system ranlib with darwin one 79 | # for some reason is not possible to override ranlib with env vars, so this is ugly but it's the only way I found 80 | if: matrix.config.os == 'macOS' 81 | run: | 82 | mv /usr/bin/ranlib /usr/bin/ranlib.bk 83 | ln -s /opt/osxcross/target/bin/${{ matrix.config.cross_compile }}-ranlib /usr/bin/ranlib 84 | 85 | - name: Build Avrdude 86 | working-directory: ${{ env.PROJECT_NAME }} 87 | run: | 88 | if [ "${{ matrix.config.os }}" = "macOS" ]; then 89 | # For darwin we disable the static flags (not supported by clang) and we make some adjustments 90 | cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compiler }}++ -DCMAKE_AR=${{ matrix.config.ar }} -DCMAKE_LINKER=${{ matrix.config.ld}} -DCMAKE_EXE_LINKER_FLAGS="-L/opt/lib/${{ matrix.config.cross_compile }}/lib/" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread -framework Foundation -framework IOKit -framework Cocoa -framework Security -DHAVE_USB_H" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -DUSE_STATIC_LIBS="ON" -DEXTRA_VERSION=${{ env.ARDUINO_TAG }} -B build/ 91 | else 92 | cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compile }}-gcc -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compile }}-g++ -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include/libusb-1.0/ -I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -DUSE_STATIC_LIBS="ON" -DEXTRA_VERSION=${{ env.ARDUINO_TAG }} -B build/ 93 | fi 94 | cmake --build build/ -v 95 | env: 96 | ARDUINO_TAG: ${{ steps.get_tag_name.outputs.ARDUINO_TAG }} 97 | 98 | - name: Package 99 | working-directory: ${{ env.PROJECT_NAME }} 100 | run: | # we need to create the subdir where to place binaries 101 | mkdir -p ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/bin ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/etc 102 | chmod +x build/src/${{ env.PROJECT_NAME }}${{ matrix.config.extension }} 103 | mv -v build/src/${{ env.PROJECT_NAME }}${{ matrix.config.extension }} ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/bin 104 | mv -v build/src/${{ env.PROJECT_NAME }}.conf ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/etc 105 | mv -v COPYING ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/LICENSE.txt 106 | tar -czv ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }} -f ${{ env.PROJECT_NAME }}_${GITHUB_REF##*/}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz 107 | 108 | - name: Upload artifacts 109 | uses: actions/upload-artifact@v4 110 | with: 111 | if-no-files-found: error 112 | name: ${{ env.ARTIFACT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }} 113 | path: ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}_* 114 | 115 | notarize-macos: 116 | runs-on: macos-latest 117 | needs: build 118 | permissions: 119 | contents: read 120 | 121 | steps: 122 | - name: Checkout repository 123 | uses: actions/checkout@v4 124 | 125 | - name: Download artifacts 126 | uses: actions/download-artifact@v4 127 | with: 128 | name: ${{ env.ARTIFACT_NAME }}_macOS_64bit 129 | path: ${{ env.DIST_DIR }} 130 | 131 | - name: Import Code-Signing Certificates 132 | env: 133 | KEYCHAIN: "sign.keychain" 134 | INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12" 135 | KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret 136 | run: | 137 | echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}" 138 | security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" 139 | security default-keychain -s "${{ env.KEYCHAIN }}" 140 | security unlock-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" 141 | security import \ 142 | "${{ env.INSTALLER_CERT_MAC_PATH }}" \ 143 | -k "${{ env.KEYCHAIN }}" \ 144 | -f pkcs12 \ 145 | -A \ 146 | -T "/usr/bin/codesign" \ 147 | -P "${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}" 148 | security set-key-partition-list \ 149 | -S apple-tool:,apple: \ 150 | -s \ 151 | -k "${{ env.KEYCHAIN_PASSWORD }}" \ 152 | "${{ env.KEYCHAIN }}" 153 | 154 | - name: Install gon for code signing and app notarization 155 | run: | 156 | wget -q https://github.com/Bearer/gon/releases/download/v0.0.27/gon_macos.zip 157 | unzip gon_macos.zip -d /usr/local/bin 158 | 159 | - name: Sign and notarize binary 160 | env: 161 | AC_USERNAME: ${{ secrets.AC_USERNAME }} 162 | AC_PASSWORD: ${{ secrets.AC_PASSWORD }} 163 | AC_PROVIDER: ${{ secrets.AC_PROVIDER }} 164 | run: | 165 | gon gon.config.hcl 166 | 167 | - name: Re-package binary 168 | # This step performs the following: 169 | # 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file) 170 | run: | 171 | # GitHub's upload/download-artifact actions don't preserve file permissions, 172 | # so we need to add execution permission back until the action is made to do this. 173 | chmod +x ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_macOS_64bit/bin/${{ env.PROJECT_NAME }} 174 | TAG="${GITHUB_REF/refs\/tags\//}" 175 | tar -czvf "${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_${TAG}_macOS_64bit.tar.gz" \ 176 | -C ${{ env.DIST_DIR }}/ ${{ env.PROJECT_NAME }}_macOS_64bit/ 177 | 178 | - name: Upload artifacts 179 | uses: actions/upload-artifact@v4 180 | with: 181 | if-no-files-found: error 182 | name: ${{ env.ARTIFACT_NAME }}_macOS_64bit 183 | path: ${{ env.DIST_DIR }} 184 | overwrite: true 185 | 186 | create-release: 187 | runs-on: 188 | ubuntu-latest 189 | permissions: 190 | contents: write 191 | needs: [build, notarize-macos] 192 | 193 | steps: 194 | - name: Checkout repository # we need package_index.template 195 | uses: actions/checkout@v4 196 | 197 | - name: Download artifact 198 | uses: actions/download-artifact@v4 199 | with: 200 | pattern: ${{ env.ARTIFACT_NAME }}* 201 | path: ${{ env.DIST_DIR }} 202 | merge-multiple: true 203 | 204 | - name: Identify Prerelease 205 | # This is a workaround while waiting for create-release action 206 | # to implement auto pre-release based on tag 207 | id: prerelease 208 | run: | 209 | wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip 210 | unzip -p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver >/tmp/semver && chmod +x /tmp/semver 211 | if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi 212 | 213 | - name: Generate package index entry 214 | run: | 215 | TAG=${GITHUB_REF/refs\/tags\//} 216 | package_index=`cat package_index.template | sed s/%%VERSION%%/${TAG}/` 217 | declare -a target_folders=("Windows_32bit" "Linux_64bit" "macOS_64bit" "Linux_32bit" "Linux_ARMv6" "Linux_ARM64") 218 | cd dist 219 | for folder in "${target_folders[@]}" 220 | do 221 | ARCHIVE_NAME=${{ env.PROJECT_NAME }}_${TAG}_${folder}.tar.gz 222 | T_OS=`echo ${folder} | awk '{print toupper($0)}'` 223 | SHASUM=`sha256sum ${ARCHIVE_NAME} | cut -f1 -d" "` 224 | SIZE=`stat --printf="%s" ${ARCHIVE_NAME}` 225 | package_index=`echo "$package_index" | 226 | sed s/%%FILENAME_${T_OS}%%/${ARCHIVE_NAME}/ | 227 | sed s/%%FILENAME_${T_OS}%%/${ARCHIVE_NAME}/ | 228 | sed s/%%SIZE_${T_OS}%%/${SIZE}/ | 229 | sed s/%%SHA_${T_OS}%%/${SHASUM}/` 230 | done 231 | cd .. 232 | echo ================== CUT ME HERE ===================== 233 | echo "${package_index}" 234 | echo "${package_index}" > package_index_draft.json 235 | 236 | - name: Create Github Release and upload artifacts 237 | uses: ncipollo/release-action@v1 238 | with: 239 | token: ${{ secrets.GITHUB_TOKEN }} 240 | draft: false 241 | prerelease: ${{ steps.prerelease.outputs.IS_PRE }} 242 | # NOTE: "Artifact is a directory" warnings are expected and don't indicate a problem 243 | # (all the files we need are in the DIST_DIR root) 244 | artifacts: "${{ env.DIST_DIR }}/*,package_index_draft.json" 245 | 246 | - name: Upload release files on Arduino downloads servers 247 | uses: docker://plugins/s3 248 | env: 249 | PLUGIN_SOURCE: "${{ env.DIST_DIR }}/*" 250 | PLUGIN_TARGET: ${{ env.AWS_PLUGIN_TARGET }} 251 | PLUGIN_STRIP_PREFIX: "${{ env.DIST_DIR }}/" 252 | PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} 253 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 254 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 255 | --------------------------------------------------------------------------------