upload #19
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release | |
| on: | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+*" | |
| jobs: | |
| core-release-from-tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name : Get the toolchain | |
| run: | | |
| 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: Setup build tools | |
| run: | | |
| 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: Build the core | |
| run: | | |
| source /opt/mbed_env/bin/activate | |
| export PATH=$PATH:/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/ | |
| extras/package_full.sh | |
| - name: Save artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: $REPOSITORY_NAME*.tar.bz2 | |
| - name: Get architecture name | |
| run: | | |
| echo "ARCHITECTURE=$(cat extras/package_index.json.NewTag.template | jq ".packages[0].platforms[0].architecture" | sed 's/\"//g')" >> $GITHUB_ENV | |
| - 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 | |
| with: | |
| repository: arduino/arduino-examples | |
| path: extras/arduino-examples | |
| - 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 |