99 core-pre-release-from-tag :
1010 runs-on : ubuntu-latest
1111
12- # container:
13- # image: arduino/arduino-cli:builder-1
14- # volumes:
15- # cache go dependencies across pipeline's steps
16- # - ${{ github.workspace }}/go:/go
17-
1812 steps :
1913 - name : Checkout repository
2014 uses : actions/checkout@v2
15+ with :
16+ path : core-repo
17+
18+ - name : Checkout ArduinoCore-API
19+ uses : actions/checkout@v2
20+ with :
21+ repository : arduino/ArduinoCore-API
22+ path : ArduinoCore-API
2123
2224 - name : Set env
2325 run : echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
2426
25- - name : Test
27+ - name : Get repo name
28+ run : echo "REPOSITORY_NAME=$(echo ${{ github.repository }} | cut -d "/" -f2-)" >> $GITHUB_ENV
29+
30+ - name : Rename core-repo path
2631 run : |
27- echo $TAG_VERSION
28- echo ${{ env.TAG_VERSION }}
32+ mv core-repo ${REPOSITORY_NAME}
2933
3034 - name : Package the new core
3135 run : |
32- extras/pack.release.bash $TAG_VERSION
36+ cd ${REPOSITORY_NAME}
37+ echo $PWD
38+ extras/pack.release.bash $TAG_VERSION $REPOSITORY_NAME
39+ cd extras
3340 mkdir staging
34- mv *.json staging/
35- mv *.tar.bz2 staging/
41+ echo $PWD
42+ mv ../*.json staging/
43+ mv ../*.tar.bz2 staging/
44+ cd ../..
3645
37- - name : Upload package_*_index.json file to Arduino downloads servers
38- uses : docker://plugins/s3
39- env :
40- PLUGIN_SOURCE : " staging/*.json*"
41- PLUGIN_TARGET : " /packages/staging/"
42- # PLUGIN_STRIP_PREFIX: "staging/"
43- PLUGIN_BUCKET : ${{ secrets.DOWNLOADS_BUCKET }}
44- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
45- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
46+ - name : Get architecture name
47+ run : |
48+ echo "ARCHITECTURE=$(cat ${REPOSITORY_NAME}/extras/package_index.json.NewTag.template | jq ".packages[0].platforms[0].architecture" | sed 's/\"//g')" >> $GITHUB_ENV
4649
47- - name : Upload *.tar.bz2 of new core to Arduino downloads servers
48- uses : docker://plugins/s3
50+ - name : Upload package_*_index.json and *.tar.bz2 file to Arduino downloads servers
4951 env :
50- PLUGIN_SOURCE : " staging/*tar.bz2"
51- PLUGIN_TARGET : " /cores/staging/"
52- # PLUGIN_STRIP_PREFIX: "staging/"
53- PLUGIN_BUCKET : ${{ secrets.DOWNLOADS_BUCKET }}
54- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
55- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
52+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
53+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
54+ 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
5657
5758 - name : Checkout Basic examples
5859 uses : actions/checkout@v2
5960 with :
6061 repository : arduino/arduino-examples
61- path : extras
62+ path : extras/arduino-examples
63+
64+ - name : Install Arduino CLI
65+ uses : arduino/setup-arduino-cli@v1.1.1
66+ with :
67+ version : " 0.14.0"
6268
63- - name : skjgs
69+ - name : Verify new core
6470 run : |
65- ./arduino-cli version
66- export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=https://downloads.arduino.cc/packages/staging/package_new_tag_${{ env.TAG_VERSION }}_index.json
67- ./arduino-cli config init --additional-urls https://downloads.arduino.cc/packages/package_staging_index.json
68- ./arduino-cli config dump --verbose
69- ./arduino-cli core update-index
70- ./arduino-cli core download arduino:samd --additional-urls http://downloads.arduino.cc/packages/staging/package_new_tag_${VERSION}_index.json -v
71- ./arduino-cli core install arduino:samd@${VERSION}
72- ./arduino-cli core update-index
73- ./arduino-cli board listall
74- ./arduino-cli compile --fqbn arduino:samd:mkrwan1300 extras/examples/01.Basics/Blink -v
71+ export PATH=$PATH:$PWD
72+ arduino-cli version
73+ cp ${REPOSITORY_NAME}/extras/staging/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json .
74+ export ARDUINO_DIRECTORIES_DATA=$PWD
75+ export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=file://$PWD/package_${REPOSITORY_NAME}_${TAG_VERSION}_index.json
76+ arduino-cli config init
77+ arduino-cli config dump -v
78+ arduino-cli core update-index -v
79+ arduino-cli core install arduino:${ARCHITECTURE}@${TAG_VERSION}
80+ INDEX=0
81+ arduino-cli board listall --format=json > boardlist.json
82+ N=$(jq '.boards | length' boardlist.json)
83+ let N=N-1
84+ echo $N
85+ 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
86+
87+ # See: https://github.com/rtCamp/action-slack-notify
88+ - name : Slack notification of core pre-release
89+ uses : rtCamp/action-slack-notify@v2.1.0
90+ env :
91+ SLACK_CHANNEL : core_releases
92+ SLACK_COLOR : good
93+ SLACK_USERNAME : ArduinoBot
94+ SLACK_ICON : https://github.com/arduino.png?size=48
95+ SLACK_TITLE : Arduino core pre-release
96+ SLACK_MESSAGE : ' Version ${{ env.TAG_VERSION }} of core ${{ env.REPOSITORY_NAME }} is now available'
97+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
98+ MSG_MINIMAL : true
0 commit comments