Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: arduino/arduino-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.7.2-rc1
Choose a base ref
...
head repository: arduino/arduino-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 19, 2019

  1. Add gRPC interface to CLI settings (#521)

    * define proto messages and service
    
    * run protoc on settings interface, regenerate code
    
    * add service implementation and tests
    
    * remove test leftovers
    Massimiliano Pippi authored Dec 19, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    23e2a9d View commit details
  2. Remove Sketchbook concept, introduce User data folder (#516)

    * rename Sketchbook folder to User
    
    * missing join on path
    Massimiliano Pippi authored Dec 19, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f11f161 View commit details

Commits on Dec 20, 2019

  1. [skip changelog] Improve the README (#525)

    * convert to rST
    * downloads links in table
    * refactored the walkthrough
    * slim down install instructions
    Massimiliano Pippi authored Dec 20, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a47c4c9 View commit details

Commits on Dec 24, 2019

  1. do not ship readme with packages (#528)

    Massimiliano Pippi authored Dec 24, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4f4c98d View commit details

Commits on Dec 27, 2019

  1. Improve error message when port or fqbn flags are not set (#523)

    * Improve error message when port or fqbn flags are missing
    
    * Redirect stderr for integration tests too
    federicobond authored and Massimiliano Pippi committed Dec 27, 2019
    Copy the full SHA
    49897ef View commit details

Commits on Dec 30, 2019

  1. check if PackagesDir exists when reporting it in HardwareDirectories() (

    phd authored and Massimiliano Pippi committed Dec 30, 2019
    Copy the full SHA
    d05a742 View commit details

Commits on Dec 31, 2019

  1. Fix update index on fresh installs (#530)

    * remove error checking on unused proto field, added deprecation comment
    
    * fix typo in function name
    
    * do not os.exit in library code
    
    * create data dir tree if it doesnt exist
    Massimiliano Pippi authored and mastrolinux committed Dec 31, 2019
    Copy the full SHA
    9061584 View commit details
  2. make config init work on fresh installs (#531)

    Massimiliano Pippi authored Dec 31, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    78c6480 View commit details

Commits on Jan 7, 2020

  1. Fix license field in lib list command (#541)

    federicobond authored and Massimiliano Pippi committed Jan 7, 2020
    Copy the full SHA
    3070048 View commit details
  2. Handle non-board serial ports in compile integration tests (#539)

    federicobond authored and Massimiliano Pippi committed Jan 7, 2020
    Copy the full SHA
    c3b78f5 View commit details
  3. [skip changelog] update copyright notice (#542)

    Massimiliano Pippi authored Jan 7, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d83170e View commit details
  4. Remove debug prints (#526)

    Massimiliano Pippi authored Jan 7, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5f4a92e View commit details
  5. Improve error message on build failure (#536)

    * Improve error message on build failure
    * properly report an error message
    Massimiliano Pippi authored Jan 7, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    85a0273 View commit details

Commits on Jan 8, 2020

  1. Fix regression on compile and upload with attached sketches (#545)

    * fix regression on board attach
    
    * fix integration tests
    Massimiliano Pippi authored Jan 8, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e2bc059 View commit details

Commits on Jan 9, 2020

  1. Use https scheme in example (#547)

    alranel authored and Massimiliano Pippi committed Jan 9, 2020
    Copy the full SHA
    48f3aaf View commit details
  2. Allow naming sketches like "RCS" and "CVS" (#537)

    * avoid paniking if main sketch file is missing
    
    * rewrite the sketch contents collection logic + tests
    
    * fix tests
    Massimiliano Pippi authored Jan 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e335327 View commit details
  3. [skip changelog] [skip ci] Clarify additional-urls option usage (#548)

    * [skip changelog] [skip ci] Clarify additional-urls option usage
    
    * rephrase flag warning
    
    * stress 3rd party point
    Roberto Sora authored Jan 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ffa84fd View commit details

Commits on Jan 14, 2020

  1. [skip changelog] Added more help on log levels (#551)

    cmaglie authored and Massimiliano Pippi committed Jan 14, 2020
    Copy the full SHA
    1f9c6f3 View commit details
  2. [skip changelog] Demonstrate the use of the gRPC Settings interface i…

    …n client_example (#554)
    
    - Demonstrate SetValue, Merge, GetValue, and GetAll.
    - Switch from the deprecated configuration request field of Init to using the Settings service to configure arduino-cli's directories.
    per1234 authored and Massimiliano Pippi committed Jan 14, 2020
    Copy the full SHA
    23e4d70 View commit details
  3. [skip changelog] Demonstrate gRPC interface's LibraryResolveDependenc…

    …ies method in client_example (#552)
    per1234 authored and Massimiliano Pippi committed Jan 14, 2020
    Copy the full SHA
    103dd8d View commit details

Commits on Jan 17, 2020

  1. Add --libraries flag to compile command (#436)

    duccio authored and Roberto Sora committed Jan 17, 2020
    4
    Copy the full SHA
    50961cd View commit details
  2. Load contents of source files only when needed (#559)

    * [skip changelog] Pass path and contents separately to SketchSaveItemCpp
    
    Previously, these two arguments were wrapped together in a sketch.Item,
    but since all callers build such an item during the call, there is no
    compelling reason to do it like this. This commit splits the Item
    parameter into a separate path and contents, which prepares for removing
    the file contents from sketch.Item later.
    
    * [skip changelog] Let SketchMergeSources return error
    
    This adds an error return value, which is currently always nil. This
    prepares for making changes that require returning errors.
    
    * [skip changelog] Let sketch.Item.GetSourceStr return error
    
    This adds an error return value to this method, which is currently
    always nil. This prepares for actually returning errors later.
    
    * Load sketch file contents only when needed
    
    Previously, the full contents of *all* sketch files would be loaded into
    memory. This includes all source and header files inside the sketch
    directory, even when they will not even be compiled (e.g.
    subdirectories other than src). In practice, only the .ino file contents
    will actually be used, so these are now read on demand.
    
    Note that when copying the sketch into the build directory, the contents
    of all these sketch files *is* used, but that code (`writeIfDifferent()`
    in `arduino/builder/sketch.go`) already did not use the preloaded data
    but read the file contents when copying.
    
    For small sketches, this does not make much of a difference, but bigger
    sketches, especially when they include libraries, core definitions,
    tools, examples, documentation, etc. the memory usage can quite explode,
    for no good reason.
    matthijskooijman authored and Roberto Sora committed Jan 17, 2020
    Copy the full SHA
    24503d5 View commit details
  3. Remove ignored Configuration GRPC API (#558)

    * Removed ignored GRPC api
    
    * Regenerate proto files
    
    * go mod tidy
    
    Co-authored-by: Roberto Sora <r.sora@arduino.cc>
    cmaglie and Roberto Sora committed Jan 17, 2020
    Copy the full SHA
    43d863d View commit details

Commits on Jan 20, 2020

  1. Fix core search not showing board name for 3rd party cores (#556)

    * use a real archive as a fake core
    
    * fix core search for 3rd party cores with tests
    Massimiliano Pippi authored Jan 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    33b9322 View commit details
  2. fix: Fix typo (#562)

    howjmay authored and Massimiliano Pippi committed Jan 20, 2020
    Copy the full SHA
    c8e2e6b View commit details
  3. [skip changelog] point the master branch in tests data (#563)

    Massimiliano Pippi authored Jan 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1952d7b View commit details

Commits on Jan 23, 2020

  1. [skip changelog] Move integration tests to pytest (#564)

    * move compilation tests to pytest
    
    * moved core tests to pytest
    
    * moved core install/upgrade/uninstall to pytest
    
    * Added detected_boards fixture
    
    Co-authored-by: Maurizio Branca <m.branca@arduino.cc>
    
    * add upload tests, remove mocked ones
    
    * use fixture
    
    * docs + dont run go tests anymore
    
    * remove debug prints, bump pytest to latest
    
    * skip problematic test on win
    
    Co-authored-by: Maurizio Branca <m.branca@arduino.cc>
    Massimiliano Pippi and Maurizio Branca authored Jan 23, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fc9b70b View commit details
  2. Fix library priority selection on some convoluted cases (#565)

    * Added test for new use cases
    
    * Moved PriorityForArchitecture in librariesresolver
    
    The method is used only in library resolver, there is not point in
    having it as method of Library.
    
    Removed also the unused SortByArchitecturePriority method.
    
    * Fixed library priority selection
    
    * Added another fix and test for lib priority
    cmaglie authored Jan 23, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cca6936 View commit details

Commits on Jan 30, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    afdf259 View commit details

Commits on Feb 4, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4903373 View commit details
  2. Add cache clean command (#560)

    * feat: Add cache clean
    
    Add command `cache clean` to clean the cache files
    depending on the loaction of the caching files
    under different OS.
    
    * feat: Add test for cache clean
    
    Clean cache files with command `arduino-cli cache clean`.
    
    * simplify test code
    
    Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>
    howjmay and masci authored Feb 4, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    947e792 View commit details

Commits on Feb 6, 2020

  1. Fix libraries priority selection (again) (#574)

    * Reorganized tests
    
    * Fixed library.IsArchitectureIndependent method.
    
    Now it returns true for libraries that do not specify "architecture"
    fiels.
    
    * Fixed yet another even more convoluted case in bundle lib selection
    
    Fix #572
    
    * Makes linter happy...
    cmaglie authored Feb 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fe48668 View commit details

Commits on Feb 11, 2020

  1. Improve precompiled libraries handling (#512)

    General change:
     - library compilation bails out if the precompiled object is found.
       This allows mixed libraries that fallback using sources if no suitable precompiled object is found
    
    ARM float specification change:
     - Cortex M4+ allows specifying different flags for floating point ABI
       This patch introduces a second level of subfolder that MUST be used is -mfpu or -mfloat-abi are specified on the commandline
       Since there's no clear specification (unlike build.mcu), the values are extracted from c++ recipe
    
       For example, for a target which commandline contains `-mfloat-abi=hard -mfpu=fpv4-sp-d16` , the precompiled search path will be
       `$libfolder/cortex-m4/fpv4-sp-d16-hard`
       If that folder doesn't exist the library will be compiled from sources
    
    Fixes arduino/arduino-builder#256
    facchinm authored Feb 11, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    469b339 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    28875e6 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    553b7be View commit details

Commits on Feb 12, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c1dcf01 View commit details
  2. Integrate Apple notarization process into Github Actions release pipe…

    …line (#578)
    
    * Migrate release creation responsibility from goreleaser to GH actions
    
    * replace s3 pointer with secret
    
    * Cosmetics on .goreleaser.yml
    
    * Cosmetics on .goreleaser.yml again
    
    * Cleanup and cosmetics
    Roberto Sora authored Feb 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1569a5f View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4ed7183 View commit details

Commits on Feb 14, 2020

  1. Fix filter sketch source for "Export cmake" output (#514)

    * fix filter sketch source
    
    * removed lines generated from preprocessor
    
    * remove file added by mistake
    
    * remove lines generated by preprocessor in c_make file
    
    * introduce again ContainerAddPrototypes
    umbynos authored Feb 14, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bc8e073 View commit details

Commits on Feb 20, 2020

  1. Restore permission lost during upload/download (#589)

    Maurizio Branca authored Feb 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    11abbee View commit details

Commits on Feb 21, 2020

  1. Added better error handling for the gRPC server. (#592)

    - Consumers of the CLI have a better exit code when it fails at startup
     - Logged message to stdout, so gRPC clients know, it is time to connect
    
    Signed-off-by: Akos Kitta <kittaakos@typefox.io>
    kittaakos authored Feb 21, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1eefe49 View commit details
  2. Implement debug feature (#590)

    * Implement first draft of debugger gRPC service
    
    * Working stdio streaming
    
    * Improved stdio passing via GRPC
    
    * Adjusted protoc definitions
    
    * Handle errors gracefully
    
    * Add recipe calculation to debug command
    
    * First implementation of debug
    
    * updated client example for testing
    
    * Add test for debug recipe generation
    
    * Implement debug command
    
    * Implement copyStream
    
    * Refactor stream helpers
    
    * Extract recipe creation from debug command
    
    * Cosmetics here and there
    
    * Refreshed client example
    
    * Replace with utils function
    
    * Remove debug leftover
    
    * Refreshed client example
    
    * Moved debug proto to its package
    
    * Removed sketch.json
    
    * Apply general cosmetics
    
    * Add test binaries
    
    * Added test case for windows path flavor
    
    * Use path.FromSlash to test debug tool command generation cross platform easily
    
    * Avoid pipe leaking via closing readers and writes in case of abnormal termination
    
    * Update client example to better catch gdb prompt
    
    * Error messages cosmetics
    
    * Use errors.Wrap instead of fmt.Errorf
    
    Co-Authored-By: Massimiliano Pippi <m.pippi@arduino.cc>
    
    * Use errors.Wrap instead of fmt.Errorf
    
    Co-Authored-By: Massimiliano Pippi <m.pippi@arduino.cc>
    
    Co-authored-by: Cristian Maglie <c.maglie@bug.st>
    Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>
    3 people authored Feb 21, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fc13047 View commit details
  3. Add support for compile with debug optimizations (#593)

    * add debug symbols option in CLI and gRPC insterface
    
    * Calculate precompiled core path usign also build optimization flags
    
    * Align failing lecacy tests with new hashing behaviour
    Roberto Sora authored Feb 21, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    88468f2 View commit details

Commits on Feb 24, 2020

  1. Allow SIGINT (ctrl-C) to be forwarded to debugger process (#596)

    * Allow SIGINT (ctrl-C) to be forwarded to debugger process
    
    * Send the correct signal to process
    cmaglie authored Feb 24, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    85effc8 View commit details

Commits on Feb 26, 2020

  1. Fix paths handling for gdb (#597)

    * When running debugger always use forward slash in paths
    
    * Add more debugging output when running debugger commandline
    
    * Temporary fix for arduino.samd core 1.8.5
    
    * Fix gdb timeout on Windows
    cmaglie authored Feb 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    561618a View commit details

Commits on Feb 28, 2020

  1. Added dependencies, license and provides_includes fields in 'lib sear…

    …ch' (#599)
    
    * Added 'license' and 'provides_includes' fields in lib search
    
    * Added 'dependencies' field in lib search
    
    * Do not output empty field in 'lib search'
    
    Fields 'license', 'provided includes' and 'dependencies' are printed
    only if populated.
    cmaglie authored Feb 28, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4b874a0 View commit details

Commits on Mar 5, 2020

  1. [skip changelog] Add CLI documentation (#602)

    * added command reference generator
    
    * add mkdocs build
    
    * add GH pages deploy step
    
    * publish docs only when pr is merged
    
    * added arduino logo
    
    * automate grpc docs generation
    
    * improve Taskfile to support local development
    
    * add docs for working on docs, much meta
    Massimiliano Pippi authored Mar 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    07e0520 View commit details
  2. [skip changelog] Revamp the README (#603)

    * fix builds when merging PRs
    
    * move contributing guidelines into docs
    
    * restore markdown format for the README
    
    * move away documentation from the README, use dedicated pages
    
    * add logo
    Massimiliano Pippi authored Mar 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bdcfd89 View commit details
  3. fix links (#604)

    Massimiliano Pippi authored Mar 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d80f119 View commit details

Commits on Mar 6, 2020

  1. Read upload port from sketch.json (#454)

    * Read upload port from sketch.json
    
    * Fix 'attach' help message
    manchoz authored Mar 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    27a9106 View commit details
Showing 1,845 changed files with 1,320,832 additions and 286,594 deletions.
10 changes: 4 additions & 6 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
comment: off

# ignore:
# - legacy/**/*
ignore:
- rpc/**
- i18n/cmd/**

coverage:
status:
project:
default:
target: 35%
threshold: null
target: 30%
patch: off
changes: off
10 changes: 0 additions & 10 deletions .dependabot/config.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@ indent_size = 4
indent_style = space
indent_size = 4

[*.yml,*.tmpl]
[*.yml,*.yaml,*.tmpl]
indent_style = space
indent_size = 2

[*.sh]
indent_style = tab
indent_size = 4
[*.{bash,sh}]
indent_size = 2
indent_style = space
81 changes: 81 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/bug-report.yml
# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms

name: Bug report
description: Report a problem with the code or documentation in this repository.
labels:
- "type: imperfection"
body:
- type: markdown
attributes:
value: |
Please see the [contributor guide](https://arduino.github.io/arduino-cli/dev/CONTRIBUTING/) for more information.
- type: textarea
id: description
attributes:
label: Describe the problem
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: To reproduce
description: Provide the specific set of steps we can follow to reproduce the problem.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: What would you expect to happen after following those instructions?
validations:
required: true
- type: input
id: project-version
attributes:
label: Arduino CLI version
description: |
Which version of Arduino CLI are you using?
(output of `arduino-cli version`)
_This should be the [nightly build](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)._
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating system
description: Which operating system(s) are you using on your computer?
multiple: true
options:
- Windows
- Linux
- macOS
- N/A
validations:
required: true
- type: input
id: os-version
attributes:
label: Operating system version
description: Which version of the operating system are you using on your computer?
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional context
description: Add any additional information here.
validations:
required: false
- type: checkboxes
id: checklist
attributes:
label: Issue checklist
description: Please double-check that you have done each of the following things before submitting the issue.
options:
- label: I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-cli/issues?q=)
required: true
- label: I verified the problem still occurs when using the [nightly build](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)
required: true
- label: My report contains all necessary details
required: true
26 changes: 0 additions & 26 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Source:
# https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/template-choosers/general/config.yml
# See:
# https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser

blank_issues_enabled: false
contact_links:
- name: Learn about using this project
url: https://arduino.github.io/arduino-cli/dev/
about: Detailed usage documentation is available here.
- name: Support request
url: https://forum.arduino.cc/c/software/arduino-cli/89
about: We can help you out on the Arduino Forum!
- name: Discuss development work on the project
url: https://groups.google.com/a/arduino.cc/g/developers
about: Arduino Developers Mailing List
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/feature-request.yml
# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms

name: Feature request
description: Suggest an enhancement to this project.
labels:
- "type: enhancement"
body:
- type: markdown
attributes:
value: |
Please see the [contributor guide](https://arduino.github.io/arduino-cli/dev/CONTRIBUTING/) for more information.
- type: textarea
id: description
attributes:
label: Describe the request
validations:
required: true
- type: textarea
id: current
attributes:
label: Describe the current behavior
description: |
What is the current behavior of Arduino CLI in relation to your request?
How can we reproduce that behavior?
validations:
required: true
- type: input
id: project-version
attributes:
label: Arduino CLI version
description: |
Which version of Arduino CLI are you using?
(output of `arduino-cli version`)
_This should be the [nightly build](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)._
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating system
description: Which operating system(s) are you using on your computer?
multiple: true
options:
- Windows
- Linux
- macOS
- N/A
validations:
required: true
- type: input
id: os-version
attributes:
label: Operating system version
description: Which version of the operating system are you using on your computer?
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional context
description: Add any additional information here.
validations:
required: false
- type: checkboxes
id: checklist
attributes:
label: Issue checklist
description: Please double-check that you have done each of the following things before submitting the issue.
options:
- label: I searched for previous requests in [the issue tracker](https://github.com/arduino/arduino-cli/issues?q=)
required: true
- label: I verified the feature was still missing when using the [nightly build](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)
required: true
- label: My request contains all necessary details
required: true
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Please check if the PR fulfills these requirements

See [how to contribute](https://arduino.github.io/arduino-cli/latest/CONTRIBUTING/)

- [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-cli/pulls)
before creating one)
- [ ] The PR follows
[our contributing guidelines](https://arduino.github.io/arduino-cli/latest/CONTRIBUTING/#pull-requests)
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] `UPGRADING.md` has been updated with a migration guide (for breaking changes)
- [ ] `configuration.schema.json` updated if new parameters are added.

## What kind of change does this PR introduce?

<!-- Bug fix, feature, docs update, ... -->

## What is the current behavior?

<!-- You can also link to an open issue here -->

## What is the new behavior?

<!-- if this is a feature change -->

## Does this PR introduce a breaking change, and is [titled accordingly](https://arduino.github.io/arduino-cli/latest/CONTRIBUTING/#breaking)?

<!-- If this PR is merged, will any users need to change their code, command-line invocations, build scripts or data files
when upgrading from an older version of Arduino CLI? -->

## Other information

<!-- Any additional information that could help the review process -->
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See: https://docs.github.com/en/code-security/supply-chain-security/configuration-options-for-dependency-updates#about-the-dependabotyml-file
version: 2

updates:
# Configure check for outdated GitHub Actions actions in workflows.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/dependabot/README.md
# See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-actions-up-to-date-with-dependabot
- package-ecosystem: github-actions
directory: / # Check the repository's workflows under /.github/workflows/
schedule:
interval: daily
labels:
- "topic: infrastructure"
commit-message:
prefix: "[skip changelog] "
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "topic: infrastructure"
commit-message:
prefix: "[skip changelog] "
rebase-strategy: disabled
27 changes: 27 additions & 0 deletions .github/label-configuration-files/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Used by the "Sync Labels" workflow
# See: https://github.com/Financial-Times/github-label-sync#label-config-file

- name: "architecture: arm64"
color: ff00ff
description: Specific to 64 bit ARM host architecture
- name: "architecture: armv6"
color: ff00ff
description: Specific to hosts using an ARMv6 core
- name: "architecture: armv7"
color: ff00ff
description: Specific to hosts using an ARMv7 core
- name: "topic: CLI"
color: "00ffff"
description: Related to the command line interface
- name: "topic: gRPC"
color: "00ffff"
description: Related to the gRPC interface
- name: "topic: packaging"
color: "00ffff"
description: Related to the release distribution package
- name: "topic: build-process"
color: "00ffff"
description: Related to the sketch build process
- name: "topic: package-management"
color: "00ffff"
description: Related to the packaging and managing of the platform/libraries
154 changes: 154 additions & 0 deletions .github/workflows/check-certificates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-certificates.md
name: Check Certificates

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-certificates.ya?ml"
pull_request:
paths:
- ".github/workflows/check-certificates.ya?ml"
schedule:
# Run every 10 hours.
- cron: "0 */10 * * *"
workflow_dispatch:
repository_dispatch:

env:
# Begin notifications when there are less than this many days remaining before expiration.
EXPIRATION_WARNING_PERIOD: 30

jobs:
check-certificates:
name: ${{ matrix.certificate.identifier }}
# Only run when the workflow will have access to the certificate secrets.
if: >
(github.event_name != 'pull_request' && github.repository == 'arduino/arduino-cli') ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'arduino/arduino-cli')
runs-on: ubuntu-latest
strategy:
fail-fast: false

matrix:
certificate:
# Additional certificate definitions can be added to this list.
- identifier: macOS signing certificate # Text used to identify certificate in notifications.
certificate-secret: INSTALLER_CERT_MAC_P12 # Name of the secret that contains the certificate.
password-secret: INSTALLER_CERT_MAC_PASSWORD # Name of the secret that contains the certificate password.
type: pkcs12
- identifier: Windows signing certificate
certificate-secret: INSTALLER_CERT_WINDOWS_CER
# The password for the Windows certificate is not needed, because its not a container, but a single certificate.
type: x509

steps:
- name: Set certificate path environment variable
run: |
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
echo "CERTIFICATE_PATH=${{ runner.temp }}/certificate.p12" >> "$GITHUB_ENV"
- name: Decode certificate
env:
CERTIFICATE: ${{ secrets[matrix.certificate.certificate-secret] }}
run: |
echo "${{ env.CERTIFICATE }}" | base64 --decode > "${{ env.CERTIFICATE_PATH }}"
- name: Verify certificate
env:
CERTIFICATE_PASSWORD: ${{ secrets[matrix.certificate.password-secret] }}
run: |
(
openssl ${{ matrix.certificate.type }} \
-in "${{ env.CERTIFICATE_PATH }}" \
-legacy \
-noout \
-passin env:CERTIFICATE_PASSWORD
) || (
echo "::error::Verification of ${{ matrix.certificate.identifier }} failed!!!"
exit 1
)
- name: Slack notification of certificate verification failure
if: failure()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: |
:warning::warning::warning::warning:
WARNING: ${{ github.repository }} ${{ matrix.certificate.identifier }} verification failed!!!
:warning::warning::warning::warning:
SLACK_COLOR: danger
MSG_MINIMAL: true
uses: rtCamp/action-slack-notify@v2

- name: Get days remaining before certificate expiration date
env:
CERTIFICATE_PASSWORD: ${{ secrets[matrix.certificate.password-secret] }}
id: get-days-before-expiration
run: |
if [[ ${{ matrix.certificate.type }} == "pkcs12" ]]; then
EXPIRATION_DATE="$(
(
openssl pkcs12 \
-in ${{ env.CERTIFICATE_PATH }} \
-clcerts \
-legacy \
-nodes \
-passin env:CERTIFICATE_PASSWORD
) | (
openssl x509 \
-noout \
-enddate
) | (
grep \
--max-count=1 \
--only-matching \
--perl-regexp \
'notAfter=(\K.*)'
)
)"
elif [[ ${{ matrix.certificate.type }} == "x509" ]]; then
EXPIRATION_DATE="$(
(
openssl x509 \
-in ${{ env.CERTIFICATE_PATH }} \
-noout \
-enddate
) | (
grep \
--max-count=1 \
--only-matching \
--perl-regexp \
'notAfter=(\K.*)'
)
)"
fi
DAYS_BEFORE_EXPIRATION="$((($(date --utc --date="$EXPIRATION_DATE" +%s) - $(date --utc +%s)) / 60 / 60 / 24))"
# Display the expiration information in the log.
echo "Certificate expiration date: $EXPIRATION_DATE"
echo "Days remaining before expiration: $DAYS_BEFORE_EXPIRATION"
echo "days=$DAYS_BEFORE_EXPIRATION" >> $GITHUB_OUTPUT
- name: Check if expiration notification period has been reached
id: check-expiration
run: |
if [[ ${{ steps.get-days-before-expiration.outputs.days }} -lt ${{ env.EXPIRATION_WARNING_PERIOD }} ]]; then
echo "::error::${{ matrix.certificate.identifier }} will expire in ${{ steps.get-days-before-expiration.outputs.days }} days!!!"
exit 1
fi
- name: Slack notification of pending certificate expiration
# Don't send spurious expiration notification if verification fails.
if: failure() && steps.check-expiration.outcome == 'failure'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: |
:warning::warning::warning::warning:
WARNING: ${{ github.repository }} ${{ matrix.certificate.identifier }} will expire in ${{ steps.get-days-before-expiration.outputs.days }} days!!!
:warning::warning::warning::warning:
SLACK_COLOR: danger
MSG_MINIMAL: true
uses: rtCamp/action-slack-notify@v2
56 changes: 56 additions & 0 deletions .github/workflows/check-easyjson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Check easyjson generated files

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-easyjson.ya?ml"
- "go.mod"
- "go.sum"
- "Taskfile.ya?ml"
- "**.go"
pull_request:
paths:
- ".github/workflows/check-easyjson.ya?ml"
- "go.mod"
- "go.sum"
- "Taskfile.ya?ml"
- "**.go"
workflow_dispatch:
repository_dispatch:

jobs:
check-easyjson-generated-files:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Regenerate easyjson source code
run: task go:easyjson-generate

- name: Check for outdated cache
id: diff
run: |
git add .
if ! git diff --cached --color --exit-code; then
echo
echo "::error::easyjson generated files out of sync."
exit 1
fi
141 changes: 141 additions & 0 deletions .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md
name: Check Go Dependencies

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"

# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-go-dependencies-task.ya?ml"
- ".licenses/**"
- ".licensed.json"
- ".licensed.ya?ml"
- "Taskfile.ya?ml"
- "**/.gitmodules"
- "**/go.mod"
- "**/go.sum"
pull_request:
paths:
- ".github/workflows/check-go-dependencies-task.ya?ml"
- ".licenses/**"
- ".licensed.json"
- ".licensed.ya?ml"
- "Taskfile.ya?ml"
- "**/.gitmodules"
- "**/go.mod"
- "**/go.sum"
schedule:
# Run periodically to catch breakage caused by external changes.
- cron: "0 8 * * WED"
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 "result=$RESULT" >> $GITHUB_OUTPUT
check-cache:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install licensed
uses: jonabc/setup-licensed@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Update dependencies license metadata cache
run: task --silent general:cache-dep-licenses

- name: Check for outdated cache
id: diff
run: |
git add .
if ! git diff --cached --color --exit-code; then
echo
echo "::error::Dependency license metadata out of sync. See: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md#metadata-cache"
exit 1
fi
# Some might find it convenient to have CI generate the cache rather than setting up for it locally
- name: Upload cache to workflow artifact
if: failure() && steps.diff.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
include-hidden-files: true
name: dep-licenses-cache
path: .licenses/

check-deps:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install licensed
uses: jonabc/setup-licensed@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check for dependencies with unapproved licenses
run: task --silent general:check-dep-licenses
253 changes: 253 additions & 0 deletions .github/workflows/check-go-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-task.md
name: Check Go

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-go-task.ya?ml"
- "Taskfile.ya?ml"
- "**/go.mod"
- "**/go.sum"
- "**.go"
pull_request:
paths:
- ".github/workflows/check-go-task.ya?ml"
- "Taskfile.ya?ml"
- "**/go.mod"
- "**/go.sum"
- "**.go"
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 "result=$RESULT" >> $GITHUB_OUTPUT
check-outdated:
name: check-outdated (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Modernize usages of outdated APIs
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: task go:fix

- name: Check if any fixes were needed
run: git diff --color --exit-code

check-style:
name: check-style (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1.0

- name: Check style
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: task --silent go:lint

check-formatting:
name: check-formatting (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Format code
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: task go:format

- name: Check formatting
run: git diff --color --exit-code

check-config:
name: check-config (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run go mod tidy
working-directory: ${{ matrix.module.path }}
run: go mod tidy

- name: Check whether any tidying was needed
run: git diff --color --exit-code

check-license-headers:
name: check-license-headers (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check for missing license headers
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: |
task go:add-license-headers
git diff --color --exit-code
# Do a simple "smoke test" build for the modules with no other form of validation
build:
name: build (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
module:
- path: internal/arduino/discovery/discovery_client
- path: rpc/internal/client_example
- path: commands/term_example

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Build
working-directory: ${{ matrix.module.path }}
run: go build
41 changes: 41 additions & 0 deletions .github/workflows/check-i18n-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check Internationalization

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
branches:
# Release branches have names like 0.8.x, 0.9.x, ...
- "[0-9]+.[0-9]+.x"
workflow_dispatch:
repository_dispatch:

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check i18n source and translation files are up to date
run: task i18n:check
env:
TRANSIFEX_ORGANIZATION: ${{ secrets.TRANSIFEX_ORGANIZATION }}
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }}
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}
67 changes: 67 additions & 0 deletions .github/workflows/check-license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-license.md
name: Check License

env:
EXPECTED_LICENSE_FILENAME: LICENSE.txt
# SPDX identifier: https://spdx.org/licenses/
EXPECTED_LICENSE_TYPE: GPL-3.0

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-license.ya?ml"
# See: https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md#detecting-the-license-file
- "[cC][oO][pP][yY][iI][nN][gG]*"
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
- "[oO][fF][lL]*"
- "[pP][aA][tT][eE][nN][tT][sS]*"
pull_request:
paths:
- ".github/workflows/check-license.ya?ml"
- "[cC][oO][pP][yY][iI][nN][gG]*"
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
- "[oO][fF][lL]*"
- "[pP][aA][tT][eE][nN][tT][sS]*"
workflow_dispatch:
repository_dispatch:

jobs:
check-license:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby # Install latest version

- name: Install licensee
run: gem install licensee

- name: Check license file
run: |
EXIT_STATUS=0
# See: https://github.com/licensee/licensee
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
echo "Detected license file: $DETECTED_LICENSE_FILE"
if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then
echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: $EXPECTED_LICENSE_FILENAME"
EXIT_STATUS=1
fi
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
echo "Detected license type: $DETECTED_LICENSE_TYPE"
if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then
echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${EXPECTED_LICENSE_TYPE}\""
EXIT_STATUS=1
fi
exit $EXIT_STATUS
130 changes: 130 additions & 0 deletions .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-markdown-task.md
name: Check Markdown

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 16.x
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"

# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-markdown-task.ya?ml"
- ".markdown-link-check.json"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
- "**/.markdownlint*"
- "**.go"
- "**.mdx?"
- "**.mkdn"
- "**.mdown"
- "**.markdown"
- "rpc/**"
pull_request:
paths:
- ".github/workflows/check-markdown-task.ya?ml"
- ".markdown-link-check.json"
- "package.json"
- "package-lock.json"
- "Taskfile.ya?ml"
- "**/.markdownlint*"
- "**.go"
- "**.mdx?"
- "**.mkdn"
- "**.mdown"
- "**.markdown"
- "rpc/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by external 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 "result=$RESULT" >> $GITHUB_OUTPUT
lint:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Initialize markdownlint-cli problem matcher
uses: xt0rted/markdownlint-problem-matcher@v3

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Lint
run: task markdown:lint

links:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Go dependencies
run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.4.1

- uses: bufbuild/buf-action@v1
with:
setup_only: true

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check links
run: task --silent markdown:check-links
66 changes: 66 additions & 0 deletions .github/workflows/check-mkdocs-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-mkdocs-task.md
name: Check Website

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
PYTHON_VERSION: "3.9"

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-mkdocs-task.ya?ml"
- "Taskfile.ya?ml"
- "mkdocs.ya?ml"
- "poetry.lock"
- "pyproject.toml"
- "docs/**"
pull_request:
paths:
- ".github/workflows/check-mkdocs-task.ya?ml"
- "Taskfile.ya?ml"
- "mkdocs.ya?ml"
- "poetry.lock"
- "pyproject.toml"
- "docs/**"
workflow_dispatch:
repository_dispatch:

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Go dependencies
run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.4.1

- uses: bufbuild/buf-action@v1
with:
setup_only: true

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry
run: pip install poetry

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Build website
run: task website:check
219 changes: 219 additions & 0 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-prettier-formatting-task.md
name: Check Prettier Formatting

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-prettier-formatting-task.ya?ml"
- "Taskfile.ya?ml"
- "**/.prettierignore"
- "**/.prettierrc*"
# CSS
- "**.css"
- "**.wxss"
# PostCSS
- "**.pcss"
- "**.postcss"
# Less
- "**.less"
# SCSS
- "**.scss"
# GraphQL
- "**.graphqls?"
- "**.gql"
# handlebars
- "**.handlebars"
- "**.hbs"
# HTML
- "**.mjml"
- "**.html?"
- "**.html.hl"
- "**.st"
- "**.xht"
- "**.xhtml"
# Vue
- "**.vue"
# JavaScript
- "**.flow"
- "**._?jsb?"
- "**.bones"
- "**.cjs"
- "**.es6?"
- "**.frag"
- "**.gs"
- "**.jake"
- "**.jscad"
- "**.jsfl"
- "**.js[ms]"
- "**.[mn]js"
- "**.pac"
- "**.wxs"
- "**.[xs]s?js"
- "**.xsjslib"
# JSX
- "**.jsx"
# TypeScript
- "**.ts"
# TSX
- "**.tsx"
# JSON
- "**/.eslintrc"
- "**.json"
- "**.avsc"
- "**.geojson"
- "**.gltf"
- "**.har"
- "**.ice"
- "**.JSON-tmLanguage"
- "**.mcmeta"
- "**.tfstate"
- "**.topojson"
- "**.webapp"
- "**.webmanifest"
- "**.yyp?"
# JSONC
- "**/.babelrc"
- "**/.jscsrc"
- "**/.js[hl]intrc"
- "**.jsonc"
- "**.sublime-*"
# JSON5
- "**.json5"
# Markdown
- "**.mdx?"
- "**.markdown"
- "**.mk?down"
- "**.mdwn"
- "**.mkdn?"
- "**.ronn"
- "**.workbook"
# YAML
- "**/.clang-format"
- "**/.clang-tidy"
- "**/.gemrc"
- "**/glide.lock"
- "**.ya?ml*"
- "**.mir"
- "**.reek"
- "**.rviz"
- "**.sublime-syntax"
- "**.syntax"
pull_request:
paths:
- ".github/workflows/check-prettier-formatting-task.ya?ml"
- "Taskfile.ya?ml"
- "**/.prettierignore"
- "**/.prettierrc*"
# CSS
- "**.css"
- "**.wxss"
# PostCSS
- "**.pcss"
- "**.postcss"
# Less
- "**.less"
# SCSS
- "**.scss"
# GraphQL
- "**.graphqls?"
- "**.gql"
# handlebars
- "**.handlebars"
- "**.hbs"
# HTML
- "**.mjml"
- "**.html?"
- "**.html.hl"
- "**.st"
- "**.xht"
- "**.xhtml"
# Vue
- "**.vue"
# JavaScript
- "**.flow"
- "**._?jsb?"
- "**.bones"
- "**.cjs"
- "**.es6?"
- "**.frag"
- "**.gs"
- "**.jake"
- "**.jscad"
- "**.jsfl"
- "**.js[ms]"
- "**.[mn]js"
- "**.pac"
- "**.wxs"
- "**.[xs]s?js"
- "**.xsjslib"
# JSX
- "**.jsx"
# TypeScript
- "**.ts"
# TSX
- "**.tsx"
# JSON
- "**/.eslintrc"
- "**.json"
- "**.avsc"
- "**.geojson"
- "**.gltf"
- "**.har"
- "**.ice"
- "**.JSON-tmLanguage"
- "**.mcmeta"
- "**.tfstate"
- "**.topojson"
- "**.webapp"
- "**.webmanifest"
- "**.yyp?"
# JSONC
- "**/.babelrc"
- "**/.jscsrc"
- "**/.js[hl]intrc"
- "**.jsonc"
- "**.sublime-*"
# JSON5
- "**.json5"
# Markdown
- "**.mdx?"
- "**.markdown"
- "**.mk?down"
- "**.mdwn"
- "**.mkdn?"
- "**.ronn"
- "**.workbook"
# YAML
- "**/.clang-format"
- "**/.clang-tidy"
- "**/.gemrc"
- "**/glide.lock"
- "**.ya?ml*"
- "**.mir"
- "**.reek"
- "**.rviz"
- "**.sublime-syntax"
- "**.syntax"
workflow_dispatch:
repository_dispatch:

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Format with Prettier
run: task general:format-prettier

- name: Check formatting
run: git diff --color --exit-code
94 changes: 94 additions & 0 deletions .github/workflows/check-protobuf-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Check Protocol Buffers

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-protobuf-task.ya?ml"
- "Taskfile.ya?ml"
- "rpc/**"
pull_request:
paths:
- ".github/workflows/check-protobuf-task.ya?ml"
- "Taskfile.ya?ml"
- "rpc/**"
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 "result=$RESULT" >> $GITHUB_OUTPUT
build:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install buf
uses: bufbuild/buf-action@v1
with:
setup_only: true

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check protocol buffers compile correctly
if: runner.os == 'Linux'
run: |
task protoc:compile
git diff --color --exit-code
check:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

# used by the protobuf breaking change detector
- name: Fetch main branch
run: |
git fetch origin master
- uses: bufbuild/buf-action@v1
with:
token: ${{ secrets.BUF_TOKEN }}
pr_comment: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
lint: ${{ github.event_name == 'pull_request' }}
format: ${{ github.event_name == 'pull_request' }}
breaking: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'buf skip breaking') }}
breaking_against: ".git#branch=origin/master,subdir=rpc"
109 changes: 109 additions & 0 deletions .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/deploy-cobra-mkdocs-versioned-poetry.md
name: Deploy Website

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
PYTHON_VERSION: "3.9"

on:
push:
branches:
# Branch to base "dev" website on. Set in siteversion.py also.
- master
# Release branches have names like 0.8.x, 0.9.x, ...
- "[0-9]+.[0-9]+.x"
paths:
- "docs/**"
- ".github/workflows/deploy-cobra-mkdocs-versioned-poetry.ya?ml"
- "go.mod"
- "go.sum"
- "Taskfile.ya?ml"
- "**.go"
- "internal/docsgen/**"
- "rpc/**"
- "mkdocs.ya?ml"
- "poetry.lock"
- "pyproject.toml"
# Run on branch or tag creation (will be filtered by the publish-determination job).
create:

jobs:
publish-determination:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
- name: Determine if documentation should be published on this workflow run
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
RESULT="true"
else
RESULT="false"
fi
echo "result=$RESULT" >> $GITHUB_OUTPUT
publish:
runs-on: ubuntu-latest
needs: publish-determination
if: needs.publish-determination.outputs.result == 'true'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Go dependencies
run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.4.1

- uses: bufbuild/buf-action@v1
with:
setup_only: true

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Create all generated documentation content
run: task docs:generate

- name: Install Python dependencies
run: poetry install --no-root

- name: Determine versioning parameters
id: determine-versioning
run: echo "data=$(poetry run python docs/siteversion/siteversion.py)" >> $GITHUB_OUTPUT

- name: Publish documentation
if: fromJson(steps.determine-versioning.outputs.data).version != null
run: |
# 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
poetry run mike deploy \
--update-aliases \
--push \
--remote origin \
${{ fromJson(steps.determine-versioning.outputs.data).version }} \
${{ fromJson(steps.determine-versioning.outputs.data).alias }}
38 changes: 38 additions & 0 deletions .github/workflows/i18n-nightly-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: i18n-nightly-push

on:
schedule:
# run every day at 1AM
- cron: "0 1 * * *"

jobs:
push-to-transifex:
# This workflow is only of value to the arduino/arduino-cli repository and
# would always fail in forks
if: github.repository == 'arduino/arduino-cli'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"

- name: Install Taskfile
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Run task i18n:update
run: task i18n:update

- name: Run task i18n:push
run: task i18n:push
env:
TRANSIFEX_ORGANIZATION: ${{ secrets.TRANSIFEX_ORGANIZATION }}
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }}
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}
50 changes: 50 additions & 0 deletions .github/workflows/i18n-weekly-pull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: i18n-weekly-pull

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"
COVERAGE_ARTIFACT: coverage-data

on:
schedule:
# run every monday at 2AM
- cron: "0 2 * * 1"
workflow_dispatch:
repository_dispatch:

jobs:
pull-from-transifex:
# This workflow is only of value to the arduino/arduino-cli repository and
# would always fail in forks
if: github.repository == 'arduino/arduino-cli'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"

- name: Install Taskfile
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Run task i18n:pull
run: task i18n:pull
env:
TRANSIFEX_ORGANIZATION: ${{ secrets.TRANSIFEX_ORGANIZATION }}
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }}
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Updated translation files
title: Updated translation files
branch: i18n/translations-update
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
35 changes: 0 additions & 35 deletions .github/workflows/nightly.yaml

This file was deleted.

311 changes: 311 additions & 0 deletions .github/workflows/publish-go-nightly-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/publish-go-nightly-task.md
name: Publish Nightly Build

env:
# As defined by the Taskfile's PROJECT_NAME variable
PROJECT_NAME: arduino-cli
# 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: /arduino-cli/
AWS_REGION: "us-east-1"
ARTIFACT_NAME: dist

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
schedule:
# run every day at 1AM
- cron: "0 1 * * *"
workflow_dispatch:
repository_dispatch:

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
create-nightly-artifacts:
outputs:
version: ${{ steps.get-version.outputs.version }}
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
- jsonschema

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Build
env:
NIGHTLY: true
run: task dist:${{ matrix.os }}

- name: Output Version
id: get-version
env:
NIGHTLY: true
run: echo "version=$(task general:get-version)" >> $GITHUB_OUTPUT

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os }}
path: ${{ env.DIST_DIR }}

notarize-macos:
name: Notarize ${{ matrix.artifact.name }}
runs-on: macos-latest
needs: create-nightly-artifacts

env:
GON_CONFIG_PATH: gon.config.hcl

strategy:
matrix:
artifact:
- artifact-suffix: macOS_64bit
name: darwin_amd64
path: "macOS_64bit.tar.gz"
- artifact-suffix: macOS_ARM64
name: darwin_arm64
path: "macOS_ARM64.tar.gz"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.artifact.artifact-suffix }}
path: ${{ env.DIST_DIR }}

- name: Remove non-notarized artifact
uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.artifact.artifact-suffix }}

- 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/Bearer/gon/releases/download/v0.0.27/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 }}" <<EOF
# See: https://github.com/Bearer/gon#configuration-file
source = ["dist/arduino-cli_osx_${{ matrix.artifact.name }}/arduino-cli"]
bundle_id = "cc.arduino.arduino-cli"
sign {
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
}
# Ask Gon for zip output to force notarization process to take place.
# The CI will ignore the zip output, using the signed binary only.
zip {
output_path = "unused.zip"
}
EOF
- name: Sign and notarize binary
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
run: |
gon "${{ env.GON_CONFIG_PATH }}"
- name: Re-package binary
working-directory: ${{ env.DIST_DIR }}
# 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.
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
VERSION=${{ needs.create-nightly-artifacts.outputs.version }}
PACKAGE_FILENAME=(${{ env.PROJECT_NAME }}_${VERSION}_${{ matrix.artifact.path }})
tar -czvf "$PACKAGE_FILENAME" \
-C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
-C ../../ LICENSE.txt
echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
- name: Upload notarized artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.artifact.artifact-suffix }}
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}

create-windows-installer:
runs-on: windows-sign-pc
needs: create-nightly-artifacts

defaults:
run:
shell: bash

env:
INSTALLER_CERT_WINDOWS_CER: "/tmp/cert.cer"
# We are hardcoding the path for signtool because is not present on the windows PATH env var by default.
# Keep in mind that this path could change when upgrading to a new runner version
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}-Windows_64bit
path: ${{ env.DIST_DIR }}

- name: Prepare PATH
uses: microsoft/setup-msbuild@v2

- name: Build MSI
id: buildmsi
run: |
VERSION=${{ needs.create-nightly-artifacts.outputs.version }}
WIX_VERSION="0.0.0" # use 0.0.0 as version for the installer since wix is picky about other alternatives, this only affects nightly builds (error CNDL0242)
PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${VERSION}_Windows_64bit"
SOURCE_DIR="${GITHUB_WORKSPACE}/${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_windows_amd64/"
MSBuild.exe ./installer/cli.wixproj -p:SourceDir="$SOURCE_DIR" -p:OutputPath="${GITHUB_WORKSPACE}/${{ env.DIST_DIR }}" -p:OutputName="$PACKAGE_FILENAME" -p:ProductVersion="$WIX_VERSION"
- name: Save Win signing certificate to file
run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}}

- name: Sign MSI
env:
MSI_FILE: ${{ steps.buildmsi.outputs.msi }} # this comes from .installer/cli.wixproj
CERT_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }}
# https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken
run: |
"${{ env.SIGNTOOL_PATH }}" sign -d "Arduino CLI" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "${{ env.MSI_FILE }}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
env:
MSI_FILE: ${{ steps.buildmsi.outputs.msi }}
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}-windows-installer
path: ${{ env.MSI_FILE }}

publish-nightly:
runs-on: ubuntu-latest
environment: production
needs:
- create-nightly-artifacts
- notarize-macos
- create-windows-installer
permissions:
contents: write
id-token: write # This is required for requesting the JWT

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: ${{ env.ARTIFACT_NAME }}-*
merge-multiple: true
path: ${{ env.DIST_DIR }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install buf
uses: bufbuild/buf-action@v1
with:
setup_only: true

- name: Collect proto files
env:
NIGHTLY: true
run: task protoc:collect

- name: Create checksum file
working-directory: ${{ env.DIST_DIR}}
run: |
VERSION=${{ needs.create-nightly-artifacts.outputs.version }}
sha256sum ${{ env.PROJECT_NAME }}_${VERSION}* > ${VERSION}-checksums.txt
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: "github_${{ env.PROJECT_NAME }}"
aws-region: ${{ env.AWS_REGION }}

- name: Upload release files on Arduino downloads servers
run: aws s3 sync ${{ env.DIST_DIR }} s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.AWS_PLUGIN_TARGET }}nightly

report:
runs-on: ubuntu-latest
needs: publish-nightly
if: failure() # Run if publish-nightly or any of its job dependencies failed

steps:
- name: Report failure
uses: masci/datadog@v1
with:
api-key: ${{ secrets.DD_API_KEY }}
events: |
- title: "${{ env.PROJECT_NAME }} nightly build failed"
text: "Nightly build workflow has failed"
alert_type: "error"
host: ${{ github.repository }}
tags:
- "project:${{ env.PROJECT_NAME }}"
- "workflow:${{ github.workflow }}"
184 changes: 184 additions & 0 deletions .github/workflows/publish-go-tester-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/publish-go-tester-task.md
name: Publish Tester Build

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/publish-go-tester-task.ya?ml"
- "go.mod"
- "go.sum"
- "Taskfile.ya?ml"
- "DistTasks.ya?ml"
- "**.go"
pull_request:
paths:
- ".github/workflows/publish-go-tester-task.ya?ml"
- "go.mod"
- "go.sum"
- "Taskfile.ya?ml"
- "DistTasks.ya?ml"
- "**.go"
workflow_dispatch:
repository_dispatch:

env:
# As defined by the Taskfile's PROJECT_NAME variable
PROJECT_NAME: arduino-cli
# As defined by the Taskfile's DIST_DIR variable
DIST_DIR: dist

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"
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.ref }}" =~ $TAG_REGEX \
]]; then
# Run the other jobs.
RESULT="true"
else
# There is no need to run the other jobs.
RESULT="false"
fi
echo "result=$RESULT" >> $GITHUB_OUTPUT
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
create-artifacts:
needs: package-name-prefix
name: Create artifact ${{ matrix.artifact.name }}
runs-on: ${{ matrix.artifact.runner }}

strategy:
matrix:
artifact:
- task: dist:Windows_32bit
path: "*Windows_32bit.zip"
name: Windows_X86-32
runner: ubuntu-latest
- task: dist:Windows_64bit
path: "*Windows_64bit.zip"
name: Windows_X86-64
runner: ubuntu-latest
- task: dist:Linux_32bit
path: "*Linux_32bit.tar.gz"
name: Linux_X86-32
runner: ubuntu-latest
- task: dist:Linux_64bit
path: "*Linux_64bit.tar.gz"
name: Linux_X86-64
runner: ubuntu-latest
- task: dist:Linux_ARMv6
path: "*Linux_ARMv6.tar.gz"
name: Linux_ARMv6
runner: ubuntu-latest
- task: dist:Linux_ARMv7
path: "*Linux_ARMv7.tar.gz"
name: Linux_ARMv7
runner: ubuntu-latest
- task: dist:Linux_ARM64
path: "*Linux_ARM64.tar.gz"
name: Linux_ARM64
runner: ubuntu-latest
- task: dist:macOS_64bit
path: "*macOS_64bit.tar.gz"
name: macOS_64
runner: ubuntu-latest
- task: dist:macOS_ARM64
path: "*macOS_ARM64.tar.gz"
name: macOS_ARM64
runner: ubuntu-24.04-arm
- task: protoc:collect
path: "*_proto.zip"
name: rpc-protocol-files
runner: ubuntu-latest
- task: dist:jsonschema
path: "*configuration.schema.json"
name: configuration-schema
runner: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install buf
uses: bufbuild/buf-action@v1
with:
setup_only: true

- name: Build
run: |
PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }}
export PACKAGE_NAME_PREFIX
task ${{ matrix.artifact.task }}
# Transfer builds to artifacts job
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
path: ${{ env.DIST_DIR }}/${{ matrix.artifact.path }}
name: ${{ matrix.artifact.name }}

checksums:
needs:
- create-artifacts
- package-name-prefix
runs-on: ubuntu-latest

steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
- name: Output checksum
run: |
TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
declare -a artifacts=($(ls -d */))
for artifact in ${artifacts[@]}
do
cd $artifact
checksum=$(sha256sum ${{ env.PROJECT_NAME }}_${TAG}*)
cd ..
echo $checksum >> ${TAG}-checksums.txt
done
- name: Upload checksum artifact
uses: actions/upload-artifact@v4
with:
path: ./*checksums.txt
name: checksums
322 changes: 322 additions & 0 deletions .github/workflows/release-go-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,322 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/release-go-task.md
name: Release

env:
# As defined by the Taskfile's PROJECT_NAME variable
PROJECT_NAME: arduino-cli
# 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: /arduino-cli/
AWS_REGION: "us-east-1"
ARTIFACT_NAME: dist

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
create-release-artifacts:
outputs:
version: ${{ steps.get-version.outputs.version }}
runs-on: ${{ matrix.env.runner }}

strategy:
matrix:
env:
- os: Windows_32bit
runner: ubuntu-latest
- os: Windows_64bit
runner: ubuntu-latest
- os: Linux_32bit
runner: ubuntu-latest
- os: Linux_64bit
runner: ubuntu-latest
- os: Linux_ARMv6
runner: ubuntu-latest
- os: Linux_ARMv7
runner: ubuntu-latest
- os: Linux_ARM64
runner: ubuntu-latest
- os: macOS_64bit
runner: ubuntu-latest
- os: macOS_ARM64
runner: ubuntu-24.04-arm

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create changelog
# Avoid creating the same changelog for each os
if: matrix.env.os == 'Windows_32bit'
uses: arduino/create-changelog@v1
with:
tag-regex: '^v[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 Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Build
run: task dist:${{ matrix.env.os }}

- name: Output Version
id: get-version
run: echo "version=$(task general:get-version)" >> $GITHUB_OUTPUT

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.env.os }}
path: ${{ env.DIST_DIR }}

notarize-macos:
name: Notarize ${{ matrix.artifact.name }}
runs-on: macos-latest
needs: create-release-artifacts

env:
GON_CONFIG_PATH: gon.config.hcl

strategy:
matrix:
artifact:
- artifact-suffix: macOS_64bit
name: darwin_amd64
path: "macOS_64bit.tar.gz"
- artifact-suffix: macOS_ARM64
name: darwin_arm64
path: "macOS_ARM64.tar.gz"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.artifact.artifact-suffix }}
path: ${{ env.DIST_DIR }}

- name: Remove non-notarized artifact
uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.artifact.artifact-suffix }}

- 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/Bearer/gon/releases/download/v0.0.27/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 }}" <<EOF
# See: https://github.com/Bearer/gon#configuration-file
source = ["dist/arduino-cli_osx_${{ matrix.artifact.name }}/arduino-cli"]
bundle_id = "cc.arduino.arduino-cli"
sign {
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
}
# Ask Gon for zip output to force notarization process to take place.
# The CI will ignore the zip output, using the signed binary only.
zip {
output_path = "unused.zip"
}
EOF
- name: Sign and notarize binary
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
run: |
gon "${{ env.GON_CONFIG_PATH }}"
- name: Re-package binary
working-directory: ${{ env.DIST_DIR }}
# 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.
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
TAG=${{ needs.create-release-artifacts.outputs.version }}
PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.artifact.path }}"
tar -czvf "$PACKAGE_FILENAME" \
-C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
-C ../../ LICENSE.txt
echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
- name: Upload notarized artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.artifact.artifact-suffix }}
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}

create-windows-installer:
runs-on: windows-sign-pc
needs: create-release-artifacts

defaults:
run:
shell: bash

env:
INSTALLER_CERT_WINDOWS_CER: "/tmp/cert.cer"
# We are hardcoding the path for signtool because is not present on the windows PATH env var by default.
# Keep in mind that this path could change when upgrading to a new runner version
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}-Windows_64bit
path: ${{ env.DIST_DIR }}

- name: Prepare PATH
uses: microsoft/setup-msbuild@v2

- name: Build MSI
id: buildmsi
run: |
TAG=${{ needs.create-release-artifacts.outputs.version }}
WIX_TAG="${TAG%%-*}" # removes "-rc*" since wix is not happy with it, this only affects RCs builds (error CNDL0108)
PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${TAG}_Windows_64bit"
SOURCE_DIR="${GITHUB_WORKSPACE}/${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_windows_amd64/"
MSBuild.exe ./installer/cli.wixproj -p:SourceDir="$SOURCE_DIR" -p:OutputPath="${GITHUB_WORKSPACE}/${{ env.DIST_DIR }}" -p:OutputName="$PACKAGE_FILENAME" -p:ProductVersion="$WIX_TAG"
- name: Save Win signing certificate to file
run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}}

- name: Sign MSI
env:
MSI_FILE: ${{ steps.buildmsi.outputs.msi }} # this comes from .installer/cli.wixproj
CERT_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }}
# https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken
run: |
"${{ env.SIGNTOOL_PATH }}" sign -d "Arduino CLI" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "${{ env.MSI_FILE }}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
env:
MSI_FILE: ${{ steps.buildmsi.outputs.msi }}
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}-windows-installer
path: ${{ env.MSI_FILE }}

create-release:
runs-on: ubuntu-latest
environment: production
needs:
- create-release-artifacts
- notarize-macos
- create-windows-installer
permissions:
contents: write
id-token: write # This is required for requesting the JWT

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: ${{ env.ARTIFACT_NAME }}-*
merge-multiple: true
path: ${{ env.DIST_DIR }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install buf
uses: bufbuild/buf-action@v1
with:
setup_only: true

- name: Collect proto files
run: task protoc:collect

- name: Add configuration JSON schema
run: task dist:jsonschema

- name: Create checksum file
working-directory: ${{ env.DIST_DIR }}
run: |
TAG=${{ needs.create-release-artifacts.outputs.version }}
sha256sum ${{ env.PROJECT_NAME }}_${TAG}* > ${TAG}-checksums.txt
- 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.0.0.zip
unzip -p /tmp/3.0.0.zip semver-tool-3.0.0/src/semver >/tmp/semver && chmod +x /tmp/semver
if [[ "$(/tmp/semver get prerel ${{ needs.create-release-artifacts.outputs.version }} )" ]]; then echo "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: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: "github_${{ env.PROJECT_NAME }}"
aws-region: ${{ env.AWS_REGION }}

- name: Upload release files on Arduino downloads servers
run: aws s3 sync ${{ env.DIST_DIR }} s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.AWS_PLUGIN_TARGET }}
23 changes: 23 additions & 0 deletions .github/workflows/release-proto-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release Proto files

on:
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
create-release-artifacts:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: bufbuild/buf-action@v1
with:
token: ${{ secrets.BUF_TOKEN }}
push: true
28 changes: 0 additions & 28 deletions .github/workflows/release.yaml

This file was deleted.

107 changes: 0 additions & 107 deletions .github/workflows/stale.yaml

This file was deleted.

140 changes: 140 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
name: Sync Labels

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/sync-labels.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
pull_request:
paths:
- ".github/workflows/sync-labels.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
schedule:
# Run daily at 8 AM UTC to sync with changes to shared label configurations.
- cron: "0 8 * * *"
workflow_dispatch:
repository_dispatch:

env:
CONFIGURATIONS_FOLDER: .github/label-configuration-files
CONFIGURATIONS_ARTIFACT: label-configuration-files

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download JSON schema for labels configuration file
id: download-schema
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
location: ${{ runner.temp }}/label-configuration-schema

- name: Install JSON schema validator
run: |
sudo npm install \
--global \
ajv-cli \
ajv-formats
- name: Validate local labels configuration
run: |
# See: https://github.com/ajv-validator/ajv-cli#readme
ajv validate \
--all-errors \
-c ajv-formats \
-s "${{ steps.download-schema.outputs.file-path }}" \
-d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}"
download:
needs: check
runs-on: ubuntu-latest

strategy:
matrix:
filename:
# Filenames of the shared configurations to apply to the repository in addition to the local configuration.
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels
- universal.yml
- tooling.yml

steps:
- name: Download
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}

- name: Pass configuration files to next job via workflow artifact
uses: actions/upload-artifact@v4
with:
path: |
*.yaml
*.yml
if-no-files-found: error
name: ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }}

sync:
needs: download
runs-on: ubuntu-latest

steps:
- name: Set environment variables
run: |
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
- name: Determine whether to dry run
id: dry-run
if: >
github.event_name == 'pull_request' ||
(
(
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
) &&
github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
)
run: |
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
# configuration.
echo "flag=--dry-run" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@v4

- name: Download configuration files artifact
uses: actions/download-artifact@v4
with:
pattern: ${{ env.CONFIGURATIONS_ARTIFACT }}-*
merge-multiple: true
path: ${{ env.CONFIGURATIONS_FOLDER }}

- name: Remove unneeded artifact
uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}-*

- name: Merge label configuration files
run: |
# Merge all configuration files
shopt -s extglob
cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}"
- name: Install github-label-sync
run: sudo npm install --global github-label-sync

- name: Sync labels
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# See: https://github.com/Financial-Times/github-label-sync
github-label-sync \
--labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
${{ steps.dry-run.outputs.flag }} \
${{ github.repository }}
213 changes: 213 additions & 0 deletions .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/test-go-task.md
name: Test Go

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.24"
COVERAGE_ARTIFACT: coverage-data

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/test-go-task.ya?ml"
- ".github/.?codecov.ya?ml"
- "dev/.?codecov.ya?ml"
- ".?codecov.ya?ml"
- "go.mod"
- "go.sum"
- "Taskfile.ya?ml"
- "**.go"
- "**/testdata/**"
pull_request:
paths:
- ".github/workflows/test-go-task.ya?ml"
- ".github/.?codecov.ya?ml"
- "dev/.?codecov.ya?ml"
- ".?codecov.ya?ml"
- "go.mod"
- "go.sum"
- "Taskfile.ya?ml"
- "**.go"
- "**/testdata/**"
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 "result=$RESULT" >> $GITHUB_OUTPUT
tests-collector:
runs-on: ubuntu-latest
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
outputs:
tests-data: ${{ steps.collection.outputs.tests-data }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Collect tests
id: collection
# jq flags must be "-cRn" see: https://stackoverflow.com/a/68859958/1655275
run: |
echo "tests-data=$(go list ./internal/integrationtest/... | grep integrationtest/ | tr "/" " " | cut -d " " -f 6 | jq -cRn '[inputs]')" >> $GITHUB_OUTPUT
test-integration:
needs: tests-collector
strategy:
fail-fast: false
matrix:
operating-system:
- windows-latest
- macos-latest
- ubuntu-latest
tests: ${{ fromJSON(needs.tests-collector.outputs.tests-data) }}

runs-on: ${{ matrix.operating-system }}

steps:
# By default, actions/checkout converts the repo's LF line endings to CRLF on the Windows runner.
- name: Disable EOL conversions
run: git config --global core.autocrlf false

- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Run tests
shell: bash
run: |
export GO_TEST_PACKAGE="github.com/arduino/arduino-cli/internal/integrationtest/${{ matrix.tests }}"
task go:integration-test
mv coverage_integration.txt coverage_integration_${{ matrix.operating-system }}_${{ matrix.tests }}.txt
- name: Upload coverage data to workflow artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.COVERAGE_ARTIFACT }}-test-integration-${{ matrix.operating-system }}-${{ matrix.tests }}
path: |
./coverage_integration_*.txt
test:
needs: run-determination
strategy:
fail-fast: false
matrix:
operating-system:
- windows-latest
- macos-latest
- ubuntu-latest

runs-on: ${{ matrix.operating-system }}

steps:
# By default, actions/checkout converts the repo's LF line endings to CRLF on the Windows runner.
- name: Disable EOL conversions
run: git config --global core.autocrlf false

- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Run tests
run: task go:test

- name: Upload coverage data to workflow artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.COVERAGE_ARTIFACT }}-test-${{ matrix.operating-system }}
path: |
./coverage_unit.txt
coverage-upload:
runs-on: ubuntu-latest
needs:
- test
- test-integration
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install gocovmerge
run: go install github.com/wadey/gocovmerge@b5bfa59

- name: Download coverage data artifact
uses: actions/download-artifact@v4
with:
pattern: ${{ env.COVERAGE_ARTIFACT }}-*
merge-multiple: true

- name: Merge all code coverage artifacts
run: gocovmerge coverage*.txt > coverage.txt

# A token is used to avoid intermittent spurious job failures caused by rate limiting.
- name: Set up Codecov upload token
run: |
if [[ "${{ github.repository }}" == "arduino/arduino-cli" ]]; then
# In order to avoid uploads of data from forks, only use the token for runs in the arduino/arduino-ide repo.
# Token is intentionally exposed.
# See: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
CODECOV_TOKEN="18b9885b-cbf2-4166-bfbb-39617323daf0"
else
# codecov/codecov-action does unauthenticated upload if empty string is passed via the `token` input.
CODECOV_TOKEN=""
fi
echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> "$GITHUB_ENV"
- name: Send unit tests coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ env.CODECOV_TOKEN }}
files: ./coverage.txt
flags: unit
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}
118 changes: 0 additions & 118 deletions .github/workflows/test.yaml

This file was deleted.

24 changes: 20 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
/debug
/arduino-cli
/arduino-cli*
/main
/.vscode/
/cmd/formatter/debug.test
/arduino-cli.yaml
/wiki
.idea
coverage_*.txt
coverage_data
__pycache__
venv
.pytest_cache
/dist
/.pytest-tmp-dir
/node_modules/
__debug_bin*
.vscode

# gRPC client example folder
/client_example/client_example
*.bin
*.elf
/rpc/internal/client_example/client_example
/rpc/internal/client_example/**/*.bin
/rpc/internal/client_example/**/*.elf

# Misc.
.DS_Store

# Mkdocs
/site/
/public/
/internal/docsgen/arduino-cli
/internal/docsgen/arduino-cli.exe
/docs/rpc/*.md
/docs/commands/*.md
/docs/configuration.schema.json

# Delve debugger binary file
__debug_bin
Loading