Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 27 additions & 80 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,102 +6,49 @@ on:
- "[0-9]+.[0-9]+.[0-9]+*"

jobs:
core-pre-release-from-tag:
core-release-from-tag:
runs-on: ubuntu-latest

steps:
- 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
- name : Get the toolchain
run: |
if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi
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
tar -xjf /opt/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 -C /opt/

- name: Checkout latest tag of ArduinoCore-API and add it to the core
- name: Setup build tools
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
sudo apt-get install -y python3 python3-pip git mercurial
mkdir /opt/mbed_env
python -m venv /opt/mbed_env/
source /opt/mbed_env/bin/activate
python3 -m pip install -r extras/requirements.txt
python3 -m pip install mbed-cli setuptools
python3 -m pip install --upgrade six
mbed config -G GCC_ARM_PATH /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/

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

- name: Get repo name
run: echo "REPOSITORY_NAME=$(echo ${{ github.repository }} | cut -d "/" -f2-)" >> $GITHUB_ENV

- name: Package the new core
run: |
extras/pack.release.bash $TAG_VERSION $REPOSITORY_NAME
cd extras
mkdir staging
echo $PWD
mv ../*.json staging/
mv ../*.tar.bz2 staging/
cd ..

- name: Get architecture name
- name: Build the core
run: |
echo "ARCHITECTURE=$(cat extras/package_index.json.NewTag.template | jq ".packages[0].platforms[0].architecture" | sed 's/\"//g')" >> $GITHUB_ENV
source /opt/mbed_env/bin/activate
export PATH=$PATH:/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/
extras/package_full.sh $TAG_VERSION

- name: Upload package_*_index.json and *.tar.bz2 file to Arduino downloads servers
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 sync extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/packages/staging/ --exclude "*" --include *.json
aws s3 sync extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/cores/staging/ --exclude "*" --include *.tar.bz2

- name: Checkout Basic examples
uses: actions/checkout@v2
- name: Save core packages as artifact
uses: actions/upload-artifact@v4
with:
repository: arduino/arduino-examples
path: extras/arduino-examples
name: ArduinoCore-mbed-packages
path: /home/runner/work/ArduinoCore-mbed/*.tar.bz2

- name: Install Arduino CLI
uses: arduino/setup-arduino-cli@v1.1.1
- name: Save core json as artifact
uses: actions/upload-artifact@v4
with:
version: "0.14.0"

- name: Download and verify new core
run: |
export PATH=$PATH:$PWD
arduino-cli version
cp extras/staging/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json .
export ARDUINO_DIRECTORIES_DATA=$PWD
export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=file://$PWD/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json
arduino-cli config init
arduino-cli config dump -v
arduino-cli core update-index -v
arduino-cli core install arduino:${ARCHITECTURE}@${TAG_VERSION}
INDEX=0
arduino-cli board listall --format=json > boardlist.json
N=$(jq '.boards | length' boardlist.json)
let N=N-1
echo $N
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

# See: https://github.com/rtCamp/action-slack-notify
- name: Slack notification of core pre-release
uses: rtCamp/action-slack-notify@v2.1.0
env:
SLACK_CHANNEL: core_releases
SLACK_COLOR: good
SLACK_USERNAME: ArduinoBot
SLACK_ICON: https://github.com/arduino.png?size=48
SLACK_TITLE: Arduino core pre-release
SLACK_MESSAGE: 'Version ${{ env.TAG_VERSION }} of core ${{ env.REPOSITORY_NAME }} is now available'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
name: ArduinoCore-mbed-json
path: /home/runner/work/ArduinoCore-mbed/*.json
56 changes: 0 additions & 56 deletions extras/pack.release.bash

This file was deleted.

2 changes: 1 addition & 1 deletion package.sh → extras/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ FLAVOUR_TAG=${FLAVOUR^^}_
FLAVOUR_NAME=${FLAVOUR,,}
VERSION_NAME=${VERSION//./-}

cat ArduinoCore-mbed/extras/mbed_$FLAVOUR_NAME-tag.template.json |
cat ArduinoCore-mbed/extras/json/mbed_$FLAVOUR_NAME-tag.template.json |
sed "s/%%VERSION%%/${VERSION}/" |
sed "s/%%${FLAVOUR_TAG}FILENAME%%/${FILENAME}/" |
sed "s/%%${FLAVOUR_TAG}CHECKSUM%%/${CHKSUM}/" |
Expand Down
8 changes: 4 additions & 4 deletions package_full.sh → extras/package_full.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Get version from git(hub) tag
export VERSION="4.4.1"
export VERSION=$1

FLAVOURS=`ls *.variables`
FLAVOURS=`find ./extras/variables/*.variables`

for flavour in $FLAVOURS; do

Expand All @@ -11,8 +11,8 @@ git reset --hard
git clean -dxf

# Clone ArduinoCore-api in parent folder and create symlinks
git clone git@github.com:arduino/ArduinoCore-API.git ../api/
git clone --depth=1 https://github.com/arduino/ArduinoCore-API.git ../api/
ln -s ../../../api/api cores/arduino/api
./package.sh $flavour
./extras/package.sh $flavour

done
27 changes: 27 additions & 0 deletions extras/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
colorama==0.3.9
urllib3[secure]>=1.26.5
junit-xml==1.8
PyYAML>=5.4
jsonschema==2.6.0
future>=0.18.0,<1.0
six==1.12.0
requests>=2.20,<3
idna>=2,<2.8
pyserial>=3,<=3.4
jinja2>=2.11.3
intelhex>=2.3.0,<3.0.0
mbed-ls>=1.5.1,<2.0
mbed-host-tests>=1.4.4,<2.0
mbed-greentea>=0.2.24,<2.0
beautifulsoup4>=4,<=4.6.3
pyelftools>=0.27,<=0.28
pycryptodome>=3.9.3,<4
pyusb>=1.0.0,<2.0.0
hidapi>=0.7.99,<0.8.0;platform_system!="Linux"
cmsis-pack-manager>=0.2.3,<0.3.0
pywin32>=301;platform_system=='Windows'
wmi==1.4.9;platform_system=='Windows'
psutil==5.6.7
cryptography>=3.2,<4
Click>=7.0,<8
cbor>=1.0.0
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.