Skip to content

Commit

Permalink
Merge branch 'master' into additional_include_paths_libs
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Mar 10, 2020
2 parents b80c5c2 + bf3124f commit a11f866
Show file tree
Hide file tree
Showing 340 changed files with 8,939 additions and 7,575 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: docs

on:
pull_request:
types:
- opened
- synchronize
- closed
paths:
# existing docs
- 'docs/**'
# changes to the cli reference generator
- 'docsgen/**'
# potential changes to commands documentation
- 'cli/**'
# potential changes to gRPC documentation
- 'rpc/**'

jobs:
build:
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 }}

- name: Setup Go
uses: actions/setup-go@v2-beta
with:
go-version: '1.13'

- name: Install Go dependencies
run: |
go version
go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
- name: Install protoc compiler
uses: arduino/setup-protoc@v1.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.6'
architecture: 'x64'

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r ./requirements_docs.txt
- name: Build docs website
run: task docs:build

- name: Deploy
# publish docs only when PR is merged
if: github.event.pull_request.merged == true
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
PLUGIN_SOURCE: 'dist/*'
PLUGIN_TARGET: '/arduino-cli/nightly'
PLUGIN_STRIP_PREFIX: 'dist/'
PLUGIN_BUCKET: 'arduino-downloads-prod-beagle'
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
121 changes: 115 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- '[0-9].[0-9].[0-9]*'

jobs:
publish-release:

create-release-artifacts:
runs-on: ubuntu-latest

container:
Expand All @@ -16,13 +17,121 @@ jobs:
- $PWD/go:/go

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

- name: build
- name: Build
run: goreleaser

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

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

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

- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: dist

- name: Get the current release tag
id: get_tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Download Gon
run: |
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.2/gon_0.2.2_macos.zip
unzip gon_0.2.2_macos.zip -d /usr/local/bin
rm -f gon_0.2.2_macos.zip
- name: Notarize binary, re-package it and update checksum
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TAG: ${{ steps.get_tag.outputs.VERSION }}
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
# This step performs the following:
# 1. Download keychain from GH secrets and decode it from base64
# 2. Add the keychain to the system keychains and unlock it
# 3. Call Gon to start notarization process (using AC_USERNAME and AC_PASSWORD)
# 4. Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
# 5. Recalculate package checksum and replace it in the goreleaser nnnnnn-checksums.txt file
run: |
echo "${{ secrets.KEYCHAIN }}" | base64 --decode > ~/Library/Keychains/apple-developer.keychain-db
security list-keychains -s ~/Library/Keychains/apple-developer.keychain-db
security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" ~/Library/Keychains/apple-developer.keychain-db
gon gon.config.hcl
# GitHub's upload/download-artifact@v1 actions don't preserve file permissions,
# so we need to add execution permission back until @v2 actions are released.
chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
tar -czvf dist/arduino-cli_${TAG}_macOS_64bit.tar.gz \
-C dist/arduino_cli_osx_darwin_amd64/ arduino-cli \
-C ../../ LICENSE.txt
CLI_CHECKSUM=$(shasum -a 256 dist/arduino-cli_${TAG}_macOS_64bit.tar.gz | cut -d " " -f 1)
perl -pi -w -e "s/.*arduino-cli_${TAG}_macOS_64bit.tar.gz/${CLI_CHECKSUM} arduino-cli_${TAG}_macOS_64bit.tar.gz/g;" dist/*-checksums.txt
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: dist
path: dist

create-release:
runs-on: ubuntu-latest
needs: notarize-macos

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

- name: Download artifact
uses: actions/download-artifact@v1
with:
name: dist

- name: Read CHANGELOG
id: changelog
run: |
body=$(cat dist/CHANGELOG.md)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo $body
echo "::set-output name=BODY::$body"
- name: Create Github Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.changelog.outputs.BODY }}
draft: false
prerelease: false

- name: Upload release files on Github
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
tag: ${{ github.ref }}
file_glob: true

- name: Upload release files on Arduino downloads servers
uses: docker://plugins/s3
env:
PLUGIN_SOURCE: 'dist/*'
PLUGIN_TARGET: '/arduino-cli/'
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 }}
AWS_DEFAULT_REGION: 'us-east-1'
run: goreleaser
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
python-version: '3.8'
architecture: 'x64'

- name: Run integration tests
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ venv

# Misc.
.DS_Store

# Mkdocs
/public/
/docsgen/arduino-cli
/docs/rpc/*.md
/docs/commands/*.md
11 changes: 1 addition & 10 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ snapshot:
name_template: '{{ .Env.PACKAGE_NAME_PREFIX }}-{{ time "20060102" }}'

release:
prerelease: auto
disable: true

changelog:
filters:
Expand Down Expand Up @@ -111,13 +111,4 @@ archives:
linux: Linux
windows: Windows
files:
- README.md
- LICENSE.txt

blob:
-
provider: s3
bucket: arduino-downloads-prod-beagle
ids:
- arduino_cli
folder: "{{ .ProjectName }}"
Loading

0 comments on commit a11f866

Please sign in to comment.