Skip to content

Commit 75bc2ba

Browse files
committed
Action for core release from tag - Initial commit
1 parent 203c290 commit 75bc2ba

File tree

3 files changed

+226
-2
lines changed

3 files changed

+226
-2
lines changed

.github/workflows/release.yaml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+*"
7+
8+
jobs:
9+
core-pre-release-from-tag:
10+
runs-on: ubuntu-latest
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+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
- name: Set env
23+
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
24+
25+
- name: Test
26+
run: |
27+
echo $TAG_VERSION
28+
echo ${{ env.TAG_VERSION }}
29+
30+
- name: Package the new core
31+
run: |
32+
extras/pack.release.bash $TAG_VERSION
33+
mkdir staging
34+
mv *.json staging/
35+
mv *.tar.bz2 staging/
36+
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+
47+
- name: Upload *.tar.bz2 of new core to Arduino downloads servers
48+
uses: docker://plugins/s3
49+
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 }}
56+
57+
- name: Checkout Basic examples
58+
uses: actions/checkout@v2
59+
with:
60+
repository: arduino/arduino-examples
61+
path: extras
62+
63+
- name: skjgs
64+
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

extras/pack.release.bash

+25-2
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,40 @@
1717
# License along with this library; if not, write to the Free Software
1818
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919

20+
# Version check removed because version string passed from jenkins was incorrect
21+
VERSION_FROM_TAG=$1
22+
echo $VERSION_FROM_TAG
2023
VERSION=`grep version= platform.txt | sed 's/version=//g'`
24+
echo $VERSION
25+
26+
if [ $VERSION != $VERSION_FROM_TAG ]; then
27+
exit 0
28+
fi
2129

2230
PWD=`pwd`
2331
FOLDERNAME=`basename $PWD`
2432
THIS_SCRIPT_NAME=`basename $0`
33+
FILENAME=core-new-tag-$VERSION.tar.bz2
2534

2635
rm -f samd-$VERSION.tar.bz2
36+
rm -f core-new-tag-$VERSION.tar.bz2
2737

2838
cd ..
29-
tar --transform "s|$FOLDERNAME|$FOLDERNAME-$VERSION|g" --exclude=extras/** --exclude=.git* --exclude=.idea -cjf samd-$VERSION.tar.bz2 $FOLDERNAME
39+
tar --exclude=extras/** --exclude=.git* --exclude=.idea -cjf $FILENAME $FOLDERNAME
3040
cd -
3141

32-
mv ../samd-$VERSION.tar.bz2 .
42+
mv ../$FILENAME .
43+
44+
CHKSUM=`sha256sum $FILENAME | awk '{ print $1 }'`
45+
SIZE=`wc -c $FILENAME | awk '{ print $1 }'`
46+
47+
cat extras/package_index.json.NewTag.template |
48+
# sed "s/%%BUILD_NUMBER%%/${BUILD_NUMBER}/" |
49+
# sed "s/%%CURR_TIME%%/${CURR_TIME_SED}/" |
50+
sed "s/%%VERSION%%/${VERSION}/" |
51+
sed "s/%%FILENAME%%/${FILENAME}/" |
52+
sed "s/%%CHECKSUM%%/${CHKSUM}/" |
53+
sed "s/%%SIZE%%/${SIZE}/" > package_new_tag_${VERSION}_index.json
54+
55+
echo "${VERSION}"
3356

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{
2+
"packages": [
3+
{
4+
"name": "arduino",
5+
"maintainer": "Arduino Betatesting",
6+
"websiteURL": "http://www.arduino.cc/",
7+
"email": "[email protected]",
8+
"help": {
9+
"online": "http://www.arduino.cc/en/Reference/HomePage"
10+
},
11+
"platforms": [
12+
{
13+
"name": "Arduino SAMD Boards (32-bits ARM Cortex-M0+) - Pre-release",
14+
"architecture": "samd",
15+
"version": "%%VERSION%%",
16+
"category": "Arduino",
17+
"help": {
18+
"online": "http://www.arduino.cc/en/Reference/HomePage"
19+
},
20+
"url": "http://downloads.arduino.cc/cores/staging/%%FILENAME%%",
21+
"archiveFileName": "%%FILENAME%%",
22+
"checksum": "SHA-256:%%CHECKSUM%%",
23+
"size": "%%SIZE%%",
24+
"boards": [
25+
{ "name": "Arduino MKR WiFi 1010" },
26+
{ "name": "Arduino Zero" },
27+
{ "name": "Arduino MKR1000" },
28+
{ "name": "Arduino MKRZERO" },
29+
{ "name": "Arduino MKR FOX 1200" },
30+
{ "name": "Arduino MKR WAN 1300" },
31+
{ "name": "Arduino MKR WAN 1310" },
32+
{ "name": "Arduino MKR GSM 1400" },
33+
{ "name": "Arduino MKR NB 1500" },
34+
{ "name": "Arduino MKR Vidor 4000" },
35+
{ "name": "Arduino Nano 33 IoT" },
36+
{ "name": "Arduino M0 Pro" },
37+
{ "name": "Arduino M0" },
38+
{ "name": "Arduino Tian" },
39+
{ "name": "Adafruit Circuit Playground Express" }
40+
],
41+
"toolsDependencies": [
42+
{
43+
"packager": "arduino",
44+
"name": "arm-none-eabi-gcc",
45+
"version": "7-2017q4"
46+
},
47+
{
48+
"packager": "arduino",
49+
"name": "bossac",
50+
"version": "1.7.0-arduino3"
51+
},
52+
{
53+
"packager": "arduino",
54+
"name": "openocd",
55+
"version": "0.10.0-arduino7"
56+
},
57+
{
58+
"packager": "arduino",
59+
"name": "CMSIS",
60+
"version": "4.5.0"
61+
},
62+
{
63+
"packager": "arduino",
64+
"name": "CMSIS-Atmel",
65+
"version": "1.2.0"
66+
},
67+
{
68+
"packager": "arduino",
69+
"name": "arduinoOTA",
70+
"version": "1.2.1"
71+
}
72+
]
73+
}
74+
],
75+
"tools": [
76+
{
77+
"name": "arm-none-eabi-gcc",
78+
"version": "7-2017q4",
79+
"systems": [
80+
{
81+
"host": "arm-linux-gnueabihf",
82+
"url": "http://downloads.arduino.cc/tools/gcc-arm-none-eabi-7-2019-q4-major-linuxarm.tar.bz2",
83+
"archiveFileName": "gcc-arm-none-eabi-7-2019-q4-major-linuxarm.tar.bz2",
84+
"checksum": "SHA-256:34180943d95f759c66444a40b032f7dd9159a562670fc334f049567de140c51b",
85+
"size": "96613739"
86+
},
87+
{
88+
"host": "aarch64-linux-gnu",
89+
"url": "http://downloads.arduino.cc/tools/gcc-arm-none-eabi-7-2018-q2-update-linuxarm64.tar.bz2",
90+
"archiveFileName": "gcc-arm-none-eabi-7-2018-q2-update-linuxarm64.tar.bz2",
91+
"checksum": "SHA-256:6fb5752fb4d11012bd0a1ceb93a19d0641ff7cf29d289b3e6b86b99768e66f76",
92+
"size": "99558726"
93+
},
94+
{
95+
"host": "i686-mingw32",
96+
"url": "http://downloads.arduino.cc/tools/gcc-arm-none-eabi-7-2017-q4-major-win32-arduino1.zip",
97+
"archiveFileName": "gcc-arm-none-eabi-7-2017-q4-major-win32-arduino1.zip",
98+
"checksum": "SHA-256:96dd0091856f4d2eb21046eba571321feecf7d50b9c156f708b2a8b683903382",
99+
"size": "131761924"
100+
},
101+
{
102+
"host": "x86_64-apple-darwin",
103+
"url": "http://downloads.arduino.cc/tools/gcc-arm-none-eabi-7-2017-q4-major-mac.tar.bz2",
104+
"archiveFileName": "gcc-arm-none-eabi-7-2017-q4-major-mac.tar.bz2",
105+
"checksum": "SHA-256:89b776c7cf0591c810b5b60067e4dc113b5b71bc50084a536e71b894a97fdccb",
106+
"size": "104550003"
107+
},
108+
{
109+
"host": "x86_64-pc-linux-gnu",
110+
"url": "http://downloads.arduino.cc/tools/gcc-arm-none-eabi-7-2017-q4-major-linux64.tar.bz2",
111+
"archiveFileName": "gcc-arm-none-eabi-7-2017-q4-major-linux64.tar.bz2",
112+
"checksum": "SHA-256:96a029e2ae130a1210eaa69e309ea40463028eab18ba19c1086e4c2dafe69a6a",
113+
"size": "99857645"
114+
},
115+
{
116+
"host": "i686-pc-linux-gnu",
117+
"url": "http://downloads.arduino.cc/tools/gcc-arm-none-eabi-7-2018-q2-update-linux32.tar.bz2",
118+
"archiveFileName": "gcc-arm-none-eabi-7-2018-q2-update-linux32.tar.bz2",
119+
"checksum": "SHA-256:090a0bc2b1956bc49392dff924a6c30fa57c88130097b1972204d67a45ce3cf3",
120+
"size": "97427309"
121+
}
122+
]
123+
}
124+
]
125+
}
126+
]
127+
}

0 commit comments

Comments
 (0)