66 - " [0-9]+.[0-9]+.[0-9]+*"
77
88jobs :
9- core-pre- release-from-tag :
9+ core-release-from-tag :
1010 runs-on : ubuntu-latest
1111
1212 steps :
1313 - name : Checkout repository
1414 uses : actions/checkout@v2
1515
16- - name : Checkout ArduinoCore-API
17- uses : actions/checkout@v2
18- with :
19- repository : arduino/ArduinoCore-API
20- path : extras/ArduinoCore-API
21-
22- - name : Check if API should be compiled in the core
23- id : checkapi
16+ - name : Get the toolchain
2417 run : |
25- if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi
18+ wget -O /opt/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 https://developer.arm.com/-/media/files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
19+ tar -xjf /opt/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 -C /opt/
2620
27- - name : Checkout latest tag of ArduinoCore-API and add it to the core
21+ - name : Setup build tools
2822 run : |
29- cd extras/ArduinoCore-API
30- git fetch --tags
31- git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
32- cd ../..
33- mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino"
34- if : steps.checkapi.outputs.IS_API == 'true'
35-
36- - name : Remove ArduinoCore-API
37- run : rm -r "$GITHUB_WORKSPACE/extras/ArduinoCore-API"
38-
39- - name : Set env
23+ sudo apt-get install -y python3 python3-pip git mercurial
24+ mkdir /opt/mbed_env
25+ python -m venv /opt/mbed_env/
26+ source /opt/mbed_env/bin/activate
27+ python3 -m pip install -r extras/requirements.txt
28+ python3 -m pip install mbed-cli setuptools
29+ python3 -m pip install --upgrade six
30+ mbed config -G GCC_ARM_PATH /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/
31+
32+ - name : Set core version
4033 run : echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
4134
4235 - name : Get repo name
4336 run : echo "REPOSITORY_NAME=$(echo ${{ github.repository }} | cut -d "/" -f2-)" >> $GITHUB_ENV
4437
45- - name : Package the new core
46- run : |
47- extras/pack.release.bash $TAG_VERSION $REPOSITORY_NAME
48- cd extras
49- mkdir staging
50- echo $PWD
51- mv ../*.json staging/
52- mv ../*.tar.bz2 staging/
53- cd ..
54-
55- - name : Get architecture name
38+ - name : Build the core
5639 run : |
57- echo "ARCHITECTURE=$(cat extras/package_index.json.NewTag.template | jq ".packages[0].platforms[0].architecture" | sed 's/\"//g')" >> $GITHUB_ENV
40+ source /opt/mbed_env/bin/activate
41+ export PATH=$PATH:/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/
42+ extras/package_full.sh $TAG_VERSION
5843
59- - name : Upload package_*_index.json and *.tar.bz2 file to Arduino downloads servers
60- env :
61- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
62- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
63- run : |
64- aws s3 sync extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/packages/staging/ --exclude "*" --include *.json
65- aws s3 sync extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/cores/staging/ --exclude "*" --include *.tar.bz2
66-
67- - name : Checkout Basic examples
68- uses : actions/checkout@v2
44+ - name : Save core packages as artifact
45+ uses : actions/upload-artifact@v4
6946 with :
70- repository : arduino/arduino-examples
71- path : extras/arduino-examples
47+ name : ArduinoCore-mbed-packages
48+ path : /home/runner/work/ArduinoCore-mbed/*.tar.bz2
7249
73- - name : Install Arduino CLI
74- uses : arduino/setup-arduino-cli@v1.1.1
50+ - name : Save core json as artifact
51+ uses : actions/upload-artifact@v4
7552 with :
76- version : " 0.14.0"
77-
78- - name : Download and verify new core
79- run : |
80- export PATH=$PATH:$PWD
81- arduino-cli version
82- cp extras/staging/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json .
83- export ARDUINO_DIRECTORIES_DATA=$PWD
84- export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=file://$PWD/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json
85- arduino-cli config init
86- arduino-cli config dump -v
87- arduino-cli core update-index -v
88- arduino-cli core install arduino:${ARCHITECTURE}@${TAG_VERSION}
89- INDEX=0
90- arduino-cli board listall --format=json > boardlist.json
91- N=$(jq '.boards | length' boardlist.json)
92- let N=N-1
93- echo $N
94- for INDEX in $(seq 0 1 $N); do arduino-cli compile --fqbn $(cat boardlist.json | jq ".boards[$INDEX].FQBN" | sed 's/\"//g') $PWD/extras/arduino-examples/examples/01.Basics/Blink; done
95-
96- # See: https://github.com/rtCamp/action-slack-notify
97- - name : Slack notification of core pre-release
98- uses : rtCamp/action-slack-notify@v2.1.0
99- env :
100- SLACK_CHANNEL : core_releases
101- SLACK_COLOR : good
102- SLACK_USERNAME : ArduinoBot
103- SLACK_ICON : https://github.com/arduino.png?size=48
104- SLACK_TITLE : Arduino core pre-release
105- SLACK_MESSAGE : ' Version ${{ env.TAG_VERSION }} of core ${{ env.REPOSITORY_NAME }} is now available'
106- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
107- MSG_MINIMAL : true
53+ name : ArduinoCore-mbed-json
54+ path : /home/runner/work/ArduinoCore-mbed/*.json
0 commit comments