Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a18c4ac

Browse files
committedDec 14, 2020
Check from platform.txt if ArduinoCore-API should be integrated
1 parent 19acb21 commit a18c4ac

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed
 

‎.github/workflows/release.yaml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
steps:
1313
- name: Checkout repository
1414
uses: actions/checkout@v2
15-
with:
16-
path: core-repo
1715

1816
- name: Checkout ArduinoCore-API
1917
uses: actions/checkout@v2
@@ -27,33 +25,27 @@ jobs:
2725
- name: Get repo name
2826
run: echo "REPOSITORY_NAME=$(echo ${{ github.repository }} | cut -d "/" -f2-)" >> $GITHUB_ENV
2927

30-
- name: Rename core-repo path
31-
run: |
32-
mv core-repo ${REPOSITORY_NAME}
33-
3428
- name: Package the new core
3529
run: |
36-
cd ${REPOSITORY_NAME}
37-
echo $PWD
3830
extras/pack.release.bash $TAG_VERSION $REPOSITORY_NAME
3931
cd extras
4032
mkdir staging
4133
echo $PWD
4234
mv ../*.json staging/
4335
mv ../*.tar.bz2 staging/
44-
cd ../..
36+
cd ..
4537
4638
- name: Get architecture name
4739
run: |
48-
echo "ARCHITECTURE=$(cat ${REPOSITORY_NAME}/extras/package_index.json.NewTag.template | jq ".packages[0].platforms[0].architecture" | sed 's/\"//g')" >> $GITHUB_ENV
40+
echo "ARCHITECTURE=$(cat extras/package_index.json.NewTag.template | jq ".packages[0].platforms[0].architecture" | sed 's/\"//g')" >> $GITHUB_ENV
4941
5042
- name: Upload package_*_index.json and *.tar.bz2 file to Arduino downloads servers
5143
env:
5244
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
5345
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
5446
run: |
55-
aws s3 sync ${REPOSITORY_NAME}/extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/packages/staging/ --exclude "*" --include *.json
56-
aws s3 sync ${REPOSITORY_NAME}/extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/cores/staging/ --exclude "*" --include *.tar.bz2
47+
aws s3 sync extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/packages/staging/ --exclude "*" --include *.json
48+
aws s3 sync extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/cores/staging/ --exclude "*" --include *.tar.bz2
5749
5850
- name: Checkout Basic examples
5951
uses: actions/checkout@v2
@@ -66,17 +58,35 @@ jobs:
6658
with:
6759
version: "0.14.0"
6860

69-
- name: Verify new core
61+
- name: Download new core
7062
run: |
7163
export PATH=$PATH:$PWD
7264
arduino-cli version
73-
cp ${REPOSITORY_NAME}/extras/staging/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json .
65+
cp extras/staging/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json .
7466
export ARDUINO_DIRECTORIES_DATA=$PWD
7567
export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=file://$PWD/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json
7668
arduino-cli config init
7769
arduino-cli config dump -v
7870
arduino-cli core update-index -v
7971
arduino-cli core install arduino:${ARCHITECTURE}@${TAG_VERSION}
72+
73+
- name: Checkout ArduinoCore-API
74+
uses: actions/checkout@v2
75+
with:
76+
repository: arduino/ArduinoCore-API
77+
path: extras/ArduinoCore-API
78+
79+
- name: Check if API should be compiled in the core
80+
id: checkapi
81+
run: |
82+
if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi
83+
84+
- name: Integrate ArduinoCore-API
85+
run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/packages/arduino/hardware/${ARCHITECTURE}/${TAG_VERSION}/cores/arduino"
86+
if: steps.checkapi.outputs.IS_API == 'true'
87+
88+
- name: Verify new core
89+
run: |
8090
INDEX=0
8191
arduino-cli board listall --format=json > boardlist.json
8292
N=$(jq '.boards | length' boardlist.json)

0 commit comments

Comments
 (0)
Please sign in to comment.