Skip to content

Commit

Permalink
Merge pull request #574 from giulcioffi/APIintegration
Browse files Browse the repository at this point in the history
Package the core with latest release of ArduinoCore-API
  • Loading branch information
aentinger authored Dec 15, 2020
2 parents 661b128 + 4c15cd0 commit d5d336c
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Checkout ArduinoCore-API
uses: actions/checkout@v2
with:
repository: arduino/ArduinoCore-API
path: extras/ArduinoCore-API

- name: Check if API should be compiled in the core
id: checkapi
run: |
if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi
- name: Checkout latest tag of ArduinoCore-API and add it to the core
run: |
cd extras/ArduinoCore-API
git fetch --tags
git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
cd ../..
mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino"
if: steps.checkapi.outputs.IS_API == 'true'

- name: Remove ArduinoCore-API
run: rm -r "$GITHUB_WORKSPACE/extras/ArduinoCore-API"

- name: Set env
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

Expand Down Expand Up @@ -52,7 +75,7 @@ jobs:
with:
version: "0.14.0"

- name: Download new core
- name: Download and verify new core
run: |
export PATH=$PATH:$PWD
arduino-cli version
Expand All @@ -63,24 +86,6 @@ jobs:
arduino-cli config dump -v
arduino-cli core update-index -v
arduino-cli core install arduino:${ARCHITECTURE}@${TAG_VERSION}
- name: Checkout ArduinoCore-API
uses: actions/checkout@v2
with:
repository: arduino/ArduinoCore-API
path: extras/ArduinoCore-API

- name: Check if API should be compiled in the core
id: checkapi
run: |
if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi
- name: Integrate ArduinoCore-API
run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/packages/arduino/hardware/${ARCHITECTURE}/${TAG_VERSION}/cores/arduino"
if: steps.checkapi.outputs.IS_API == 'true'

- name: Verify new core
run: |
INDEX=0
arduino-cli board listall --format=json > boardlist.json
N=$(jq '.boards | length' boardlist.json)
Expand Down

0 comments on commit d5d336c

Please sign in to comment.