Skip to content

Commit b99d2eb

Browse files
committed
Package the core with ArduinoCore-API latest release
1 parent 661b128 commit b99d2eb

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

.github/workflows/release.yaml

+31-19
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,36 @@ jobs:
1313
- name: Checkout repository
1414
uses: actions/checkout@v2
1515

16+
- name: Get Latest Release
17+
id: latest_API_version
18+
uses: abatilo/[email protected]
19+
with:
20+
owner: arduino
21+
repo: ArduinoCore-API
22+
23+
- name: Set ArduinoCore-API latest version as env variable
24+
run: |
25+
echo "LATEST_TAG_API=$(echo ${{ steps.latest_API_version.outputs.latest_tag }})" >> $GITHUB_ENV
26+
27+
- name: Checkout ArduinoCore-API
28+
uses: actions/checkout@v2
29+
with:
30+
repository: arduino/ArduinoCore-API
31+
ref: ${{ env.LATEST_TAG_API }}
32+
path: extras/ArduinoCore-API
33+
34+
- name: Check if API should be compiled in the core
35+
id: checkapi
36+
run: |
37+
if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi
38+
39+
- name: Integrate ArduinoCore-API
40+
run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino"
41+
if: steps.checkapi.outputs.IS_API == 'true'
42+
43+
- name: Remove ArduinoCore-API
44+
run: rm -r "$GITHUB_WORKSPACE/extras/ArduinoCore-API"
45+
1646
- name: Set env
1747
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
1848

@@ -52,7 +82,7 @@ jobs:
5282
with:
5383
version: "0.14.0"
5484

55-
- name: Download new core
85+
- name: Download and verify new core
5686
run: |
5787
export PATH=$PATH:$PWD
5888
arduino-cli version
@@ -63,24 +93,6 @@ jobs:
6393
arduino-cli config dump -v
6494
arduino-cli core update-index -v
6595
arduino-cli core install arduino:${ARCHITECTURE}@${TAG_VERSION}
66-
67-
- name: Checkout ArduinoCore-API
68-
uses: actions/checkout@v2
69-
with:
70-
repository: arduino/ArduinoCore-API
71-
path: extras/ArduinoCore-API
72-
73-
- name: Check if API should be compiled in the core
74-
id: checkapi
75-
run: |
76-
if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi
77-
78-
- name: Integrate ArduinoCore-API
79-
run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/packages/arduino/hardware/${ARCHITECTURE}/${TAG_VERSION}/cores/arduino"
80-
if: steps.checkapi.outputs.IS_API == 'true'
81-
82-
- name: Verify new core
83-
run: |
8496
INDEX=0
8597
arduino-cli board listall --format=json > boardlist.json
8698
N=$(jq '.boards | length' boardlist.json)

0 commit comments

Comments
 (0)