Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Nightly build

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

jobs:
create-nightly-artifacts:
# This workflow is only of value to the arduino/arduino-arduino-lint repository and
# would always fail in forks
if: github.repository == 'arduino/arduino-lint'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Build
env:
CUSTOM_VERSION: nightly
run: task dist:all

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist

notarize-macos:
runs-on: macos-latest
needs: create-nightly-artifacts

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
# to ensure compatibility with v1
path: dist

- name: Import Code-Signing Certificates
env:
KEYCHAIN: "sign.keychain"
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
run: |
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > ${{ env.INSTALLER_CERT_MAC_PATH }}
security create-keychain -p ${{ env.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}
security default-keychain -s ${{ env.KEYCHAIN }}
security unlock-keychain -p ${{ env.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}
security import ${{ env.INSTALLER_CERT_MAC_PATH }} -k ${{ env.KEYCHAIN }} -f pkcs12 -A -T /usr/bin/codesign -P ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}
security set-key-partition-list -S apple-tool:,apple: -s -k ${{ env.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}

- name: Install gon for code signing and app notarization
run: |
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.3/gon_macos.zip
unzip gon_macos.zip -d /usr/local/bin

- name: Sign and notarize binary
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
run: |
gon gon.config.hcl

- name: Re-package binary and update checksum
# This step performs the following:
# 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
# 2. Recalculate package checksum and replace it in the goreleaser nnnnnn-checksums.txt file
run: |
# GitHub's upload/download-artifact@v2 action doesn't preserve file permissions,
# so we need to add execution permission back until the action is made to do this.
chmod +x dist/arduino-lint_osx_darwin_amd64/arduino-lint
PACKAGE_FILENAME="$(basename dist/arduino-lint_nightly-*_macOS_64bit.tar.gz)"
tar -czvf dist/$PACKAGE_FILENAME \
-C dist/arduino-lint_osx_darwin_amd64/ arduino-lint \
-C ../../ LICENSE.txt
CLI_CHECKSUM=$(shasum -a 256 dist/$PACKAGE_FILENAME | cut -d " " -f 1)
perl -pi -w -e "s/.*${PACKAGE_FILENAME}/${CLI_CHECKSUM} ${PACKAGE_FILENAME}/g;" dist/*-checksums.txt

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist

publish-nightly:
runs-on: ubuntu-latest
needs: notarize-macos

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dist
# to ensure compatibility with v1
path: dist

- name: Upload release files on Arduino downloads servers
uses: docker://plugins/s3
env:
PLUGIN_SOURCE: "dist/*"
PLUGIN_TARGET: "/arduino-lint/nightly"
PLUGIN_STRIP_PREFIX: "dist/"
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Report failure
if: failure()
uses: masci/datadog@v1
with:
api-key: ${{ secrets.DD_API_KEY }}
events: |
- title: "arduino-lint nightly build failed"
text: "Nightly build workflow has failed"
alert_type: "error"
host: ${{ github.repository }}
tags:
- "project:arduino-lint"
- "workflow:${{ github.workflow }}"
7 changes: 4 additions & 3 deletions DistTasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,18 @@ tasks:
PACKAGE_NAME: "{{ .PROJECT_NAME }}_{{ .VERSION }}_{{ .PACKAGE_PLATFORM }}.tar.gz"

vars:
VERSION:
TAG:
sh: echo "`git describe --tags --abbrev=0`"
TIMESTAMP_SHORT:
sh: echo "{{now | date "20060102"}}"
VERSION: "{{if .CUSTOM_VERSION}}{{.CUSTOM_VERSION}}-{{.TIMESTAMP_SHORT}}{{else}}{{.TAG}}{{end}}"
DIST_LDFLAGS: >-
-ldflags
'
-X {{ .CONFIGURATION_PACKAGE }}.version={{.VERSION}}
-X {{ .CONFIGURATION_PACKAGE }}.version={{.TAG}}
-X {{ .CONFIGURATION_PACKAGE }}.commit={{.COMMIT}}
-X {{ .CONFIGURATION_PACKAGE }}.buildTimestamp={{.TIMESTAMP}}
'
CONTAINER: "docker.elastic.co/beats-dev/golang-crossbuild"
GO_VERSION: "1.14.7"
CHECKSUM_FILE: "{{ .VERSION }}-{{ .TIMESTAMP_SHORT }}-checksums.txt"
CHECKSUM_FILE: "{{ .VERSION }}-checksums.txt"
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
# arduino-lint

[![Tests Status](https://github.com/arduino/arduino-lint/workflows/Run%20tests/badge.svg)](https://github.com/arduino/arduino-lint/actions?workflow=Run+tests)
[![Nightly Status](https://github.com/arduino/arduino-lint/workflows/Nightly%20build/badge.svg)](https://github.com/arduino/arduino-lint/actions?workflow=Nightly+build)
[![Docs Status](https://github.com/arduino/arduino-lint/workflows/Publish%20documentation/badge.svg)](https://github.com/arduino/arduino-lint/actions?workflow=Publish+documentation)

**arduino-lint** is a command line tool that checks for common problems in [Arduino](https://www.arduino.cc/) projects:

- Sketches
- Libraries

## Documentation

For usage instructions, see [the documentation](https://arduino.github.io/arduino-lint/latest/)

## Continuous Integration

There is a GitHub Actions action that makes it easy to use **arduino-lint**` in your CI workflows!

See https://github.com/arduino/arduino-lint-action for more information.

## How to contribute

Contributions are welcome!

Please see the [How to contribute](https://arduino.github.io/arduino-lint/latest/CONTRIBUTING/) page for information on
building the source code, running tests, and contributing your changes to the project.

### Beta testing

[Nightly builds](https://arduino.github.io/arduino-lint/latest/installation/#nightly-builds) are available for beta
testing.
3 changes: 3 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ There are several ways you can get involved:
| ------------------------------------------------- | ------------------------------------------------------- |
| - Support request<br/>- Question<br/>- Discussion | Post on the [Arduino Forum][forum] |
| - Bug report<br/>- Feature request | Issue report (read the [issue guidelines][issues]) |
| Beta testing | Try out the [nightly build][nightly] |
| - Bug fix<br/>- Enhancement | Pull Request (read the [pull request guidelines][prs]) |
| Monetary | - [Donate][donate]<br/>- [Buy official products][store] |

[forum]: https://forum.arduino.cc/index.php?board=3.0
[issues]: #issue-reports
[nightly]: installation.md#nightly-builds
[prs]: #pull-requests
[donate]: https://www.arduino.cc/en/Main/Contribute
[store]: https://store.arduino.cc
Expand All @@ -26,6 +28,7 @@ High quality bug reports and feature requests are valuable contributions to the

### Before reporting an issue

- Give the [nightly build](installation.md#nightly-builds) a test drive to see if your issue was already resolved.
- Search [existing pull requests and issues](https://github.com/arduino/arduino-lint/issues?q=) to see if it was already
reported. If you have additional information to provide about an existing issue, please comment there. You can use
[GitHub's "Reactions" feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) if you
Expand Down
28 changes: 26 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-lint/main/etc/insta
If you would like to use the `arduino-lint` command from any location, install arduino-lint to a directory already in
your `PATH` or add the arduino-lint installation path to your `PATH` environment variable.

If you want to download a specific arduino-lint version, for example `0.9.0`, pass the version number as a parameter
like this:
If you want to download a specific arduino-lint version, for example `0.9.0` or `nightly-latest`, pass the version
number as a parameter like this:

```
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-lint/main/etc/install.sh | sh -s 0.9.0
Expand Down Expand Up @@ -53,6 +53,30 @@ already in your `PATH` or add the arduino-lint installation path to your `PATH`

These are available from the "Assets" sections on the [releases page](https://github.com/arduino/arduino-lint/releases).

#### Nightly builds

These builds are generated every day at 01:00 GMT from the `main` branch and should be considered unstable. In order to
get the latest nightly build available for the supported platform, use the following links:

| Platform | | |
| --------- | ---------------------------- | ---------------------------- |
| Linux | [32 bit][linux32-nightly] | [64 bit][linux64-nightly] |
| Linux ARM | [32 bit][linuxarm32-nightly] | [64 bit][linuxarm64-nightly] |
| Windows | [32 bit][windows32-nightly] | [64 bit][windows64-nightly] |
| macOS | | [64 bit][macos-nightly] |

[linux64-nightly]: https://downloads.arduino.cc/arduino-lint/nightly/arduino-lint_nightly-latest_Linux_64bit.tar.gz
[linux32-nightly]: https://downloads.arduino.cc/arduino-lint/nightly/arduino-lint_nightly-latest_Linux_32bit.tar.gz
[linuxarm64-nightly]: https://downloads.arduino.cc/arduino-lint/nightly/arduino-lint_nightly-latest_Linux_ARM64.tar.gz
[linuxarm32-nightly]: https://downloads.arduino.cc/arduino-lint/nightly/arduino-lint_nightly-latest_Linux_ARMv7.tar.gz
[windows64-nightly]: https://downloads.arduino.cc/arduino-lint/nightly/arduino-lint_nightly-latest_Windows_64bit.zip
[windows32-nightly]: https://downloads.arduino.cc/arduino-lint/nightly/arduino-lint_nightly-latest_Windows_32bit.zip
[macos-nightly]: https://downloads.arduino.cc/arduino-lint/nightly/arduino-lint_nightly-latest_macOS_64bit.tar.gz

> These links return a `302: Found` response, redirecting to latest generated builds by replacing `latest` with the
> latest available build date, using the format YYYYMMDD (i.e for 2019-08-06 `latest` is replaced with `20190806` )

Checksums for the nightly builds are available at
`https://downloads.arduino.cc/arduino-lint/nightly/nightly-<DATE>-checksums.txt`

### Build from source
Expand Down
12 changes: 11 additions & 1 deletion etc/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,17 @@ downloadFile() {
else
ARDUINO_LINT_DIST="${PROJECT_NAME}_${TAG}_${OS}_${ARCH}.tar.gz"
fi
DOWNLOAD_URL="https://downloads.arduino.cc/${PROJECT_NAME}/${ARDUINO_LINT_DIST}"

# Support specifying nightly build versions (e.g., "nightly-latest") via the script argument.
case "$TAG" in
nightly*)
DOWNLOAD_URL="https://downloads.arduino.cc/${PROJECT_NAME}/nightly/${ARDUINO_LINT_DIST}"
;;
*)
DOWNLOAD_URL="https://downloads.arduino.cc/${PROJECT_NAME}/${ARDUINO_LINT_DIST}"
;;
esac

ARDUINO_LINT_TMP_FILE="/tmp/$ARDUINO_LINT_DIST"
echo "Downloading $DOWNLOAD_URL"
httpStatusCode=$(getFile "$DOWNLOAD_URL" "$ARDUINO_LINT_TMP_FILE")
Expand Down