9
9
core-pre-release-from-tag :
10
10
runs-on : ubuntu-latest
11
11
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
-
18
12
steps :
19
13
- name : Checkout repository
20
14
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
21
23
22
24
- name : Set env
23
25
run : echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
24
26
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
26
31
run : |
27
- echo $TAG_VERSION
28
- echo ${{ env.TAG_VERSION }}
32
+ mv core-repo ${REPOSITORY_NAME}
29
33
30
34
- name : Package the new core
31
35
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
33
40
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 ../..
36
45
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
46
49
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
49
51
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
56
57
57
58
- name : Checkout Basic examples
58
59
uses : actions/checkout@v2
59
60
with :
60
61
repository : arduino/arduino-examples
61
- path : extras
62
+ path : extras/arduino-examples
63
+
64
+ - name : Install Arduino CLI
65
+
66
+ with :
67
+ version : " 0.14.0"
62
68
63
- - name : skjgs
69
+ - name : Verify new core
64
70
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
+
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