Skip to content

Commit 74e68be

Browse files
committed
Fix to PR build script (follow semver)
1 parent 8fe631f commit 74e68be

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Diff for: extras/pack.pullrequest.bash

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#!/bin/bash -ex
22

33
PR_NUMBER=$1
4-
VERSION=PR-$PR_NUMBER
4+
BUILD_NUMBER=$2
5+
VERSION=`grep version= platform.txt | sed 's/version=//g'`
56

67
PWD=`pwd`
78
FOLDERNAME=`basename $PWD`
89
THIS_SCRIPT_NAME=`basename $0`
9-
FILENAME=package_samd-PR-$PR_NUMBER.tar.bz2
10+
FILENAME=package_samd-b${BUILD_NUMBER}.tar.bz2
1011

1112
rm -f $FILENAME
1213

1314
# Change name in platform.txt
14-
sed -i "s/name=.*/name=SAMD Pull request Build ${PR_NUMBER}/" platform.txt
15+
sed -i "s/name=.*/name=SAMD Pull request #${PR_NUMBER} (Build ${BUILD_NUMBER})/" platform.txt
1516

1617
cd ..
17-
tar --transform "s|$FOLDERNAME|samd-PR-$PR_NUMBER|g" --exclude=extras/** --exclude=.git* --exclude=.idea -cjf $FILENAME $FOLDERNAME
18+
tar --transform "s|$FOLDERNAME|samd-PR${PR_NUMBER}_b${BUILD_NUMBER}|g" --exclude=extras/** --exclude=.git* --exclude=.idea -cjf $FILENAME $FOLDERNAME
1819
cd -
1920

2021
mv ../$FILENAME .
@@ -24,8 +25,9 @@ SIZE=`wc -c $FILENAME | awk '{ print $1 }'`
2425

2526
cat extras/package_index.json.PR.template |
2627
sed s/%%PR_NUMBER%%/${PR_NUMBER}/ |
27-
sed s/%%VERSION%%/${VERSION}/ |
28+
sed s/%%BUILD_NUMBER%%/${BUILD_NUMBER}/ |
29+
sed s/%%VERSION%%/${VERSION}-build-${BUILD_NUMBER}/ |
2830
sed s/%%FILENAME%%/${FILENAME}/ |
2931
sed s/%%CHECKSUM%%/${CHKSUM}/ |
30-
sed s/%%SIZE%%/${SIZE}/ > package_samd-PR-${PR_NUMBER}_index.json
32+
sed s/%%SIZE%%/${SIZE}/ > package_samd-b${BUILD_NUMBER}_index.json
3133

Diff for: extras/package_index.json.PR.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"platforms": [
1212
{
13-
"name": "Arduino SAMD core - Pull request build num. %%PR_NUMBER%%",
13+
"name": "Arduino SAMD core - Pull request #%%PR_NUMBER%% (build %%BUILD_NUMBER%%)",
1414
"architecture": "samd",
1515
"version": "%%VERSION%%",
1616
"category": "Arduino",

Diff for: platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# For more info:
2020
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
2121

22-
name=Arduino SAMD (32-bits ARM Cortex-M0+) Boards
22+
name=SAMD Pull request #40 (Build 873)
2323
version=1.6.0
2424

2525
# Compile variables

0 commit comments

Comments
 (0)