forked from adafruit/Adafruit_nRF52_Arduino
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge for Release 1.0.0 See merge request smartme.io/arancino/ide/arancino-nrf52-core!1
- Loading branch information
Showing
205 changed files
with
37,714 additions
and
110,758 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
image: smartmeio/arancino-library-build | ||
|
||
|
||
stages: | ||
- start | ||
- package | ||
- upload | ||
- cleanup | ||
|
||
################################# | ||
####### START ####### | ||
################################# | ||
|
||
####### START | ||
start: | ||
stage: start | ||
|
||
variables: | ||
GIT_STRATEGY: none | ||
|
||
script: | ||
- mkdir -p tmp | ||
- echo `date +%Y-%m-%d` > tmp/date.txt | ||
- echo `date +%H-%M-%S` > tmp/time.txt | ||
|
||
artifacts: | ||
paths: | ||
- tmp/ | ||
|
||
expire_in: 1d | ||
|
||
only: | ||
- tags | ||
|
||
except: | ||
- master | ||
- branches | ||
|
||
######## PUSH | ||
push: | ||
stage: start | ||
when: manual | ||
only: ['tags'] | ||
except: ['master', 'branches'] | ||
|
||
allow_failure: true | ||
|
||
variables: | ||
GIT_STRATEGY: clone | ||
|
||
before_script: | ||
- eval `python3 check-version-tag.py ${CI_COMMIT_TAG}` | ||
|
||
script: | ||
#- apk add git | ||
- git remote add github https://$GITHUB_BOT_USERNAME:[email protected]/$GITHUB_DEST_REPO | ||
#- git remote show github | ||
#- git remote show origin | ||
#- git branch -a | ||
- git checkout $CI_COMMIT_TAG | ||
- git fetch github | ||
#- git push github $CI_COMMIT_REF_NAME --force | ||
- > | ||
if [[ ${PRE_RELEASE} == "test" ]]; then | ||
echo "not performing TAG push"; | ||
else | ||
git push github ${CI_COMMIT_TAG} | ||
fi | ||
- git push github --all --force | ||
|
||
################################# | ||
####### PACKAGE ####### | ||
################################# | ||
|
||
####### Package Release ####### | ||
package_release: | ||
stage: package | ||
variables: | ||
GIT_SUBMODULE_STRATEGY: recursive | ||
|
||
script: | ||
# create some variables into temp folder | ||
- PKG_NAME=$PLATFORM_NAME-$CI_COMMIT_TAG | ||
- PKG_NAME_PIO=framework-arduino-nrf52-arancino-$CI_COMMIT_TAG | ||
|
||
- echo $PKG_NAME > tmp/pkg_name.txt | ||
- echo $PKG_NAME_PIO > tmp/pkg_name_pio.txt | ||
- echo $CI_COMMIT_TAG > tmp/target_path.txt | ||
|
||
- sed -i "s:\(ARANCINO_CORE_VERSION\) .*:\1 \"$CI_COMMIT_TAG\":" ./cores/nRF5/Arduino.h | ||
- sed -i "s:\(version\)=.*:\1=$CI_COMMIT_TAG:" ./platform.txt | ||
- jq --arg tag_ver ${CI_COMMIT_TAG} '.version = $tag_ver' package.json|sponge package.json | ||
|
||
# adding ArduinoJson into core | ||
- git clone $REPO_LIB_ARDUINOJSON_URL -b v6.18.0 libraries/ArduinoJson | ||
|
||
# adding MsgPack into core | ||
- git clone $REPO_LIB_MSGPACK_URL -b 0.3.8 libraries/MsgPack | ||
|
||
# adding MsgPacketizer into core | ||
- git clone $REPO_LIB_MSGPACKETIZER_URL -b 0.3.0 libraries/MsgPacketizer | ||
|
||
# adding Microcontroller ID into core | ||
- git clone $REPO_LIB_MICROCONTROLLER_ID_URL -b 1.0.0 libraries/Microcontroller-id | ||
|
||
# adding MQTT PubSubClient into core | ||
- git clone $REPO_LIB_PUBSUBCLIENT_URL -b v2.8 libraries/PubSubClient | ||
|
||
- cd .. | ||
# tar files and move temp folder back | ||
- tar --exclude=tmp --exclude=.git* --exclude=*.DS_Store* -cvjf $PKG_NAME.tar.bz2 $CI_PROJECT_NAME | ||
|
||
# pio packaging | ||
- cp -r $CI_PROJECT_NAME framework-arduino-nrf52-arancino | ||
- tar --exclude=tmp --exclude=.git* --exclude=*.DS_Store* -cvjf $PKG_NAME_PIO.tar.bz2 framework-arduino-nrf52-arancino | ||
|
||
# move tar into temp folder | ||
- cd $CI_PROJECT_NAME | ||
- mv ../$PKG_NAME.tar.bz2 tmp/ | ||
- mv ../$PKG_NAME_PIO.tar.bz2 tmp/ | ||
|
||
# create files containing sha 256 checksum and size in bytes of the tar file | ||
- sha256sum tmp/$PKG_NAME.tar.bz2 | awk '{print $1}' > tmp/SHA256.txt | ||
- du -b tmp/$PKG_NAME.tar.bz2 | awk {'print $1}' > tmp/SIZE.txt | ||
- echo FILENAME $PKG_NAME.tar.bz2 | ||
- echo SHA-256 `cat tmp/SHA256.txt` | ||
- echo SIZE `cat tmp/SIZE.txt` | ||
- echo PKG_NAME `cat tmp/pkg_name.txt` | ||
|
||
# same step above but for PIO | ||
- sha256sum tmp/$PKG_NAME_PIO.tar.bz2 | awk '{print $1}' > tmp/SHA256_pio.txt | ||
- du -b tmp/$PKG_NAME_PIO.tar.bz2 | awk {'print $1}' > tmp/SIZE_pio.txt | ||
- echo FILENAME_PIO $PKG_NAME_PIO.tar.bz2 | ||
- echo SHA-256-PIO `cat tmp/SHA256_pio.txt` | ||
- echo SIZE_PIO `cat tmp/SIZE_pio.txt` | ||
- echo PKG_NAME_PIO `cat tmp/pkg_name_pio.txt` | ||
|
||
dependencies: | ||
- start | ||
|
||
artifacts: | ||
paths: | ||
- tmp/ | ||
except: | ||
- branches | ||
- master | ||
|
||
only: | ||
- tags | ||
|
||
################################# | ||
####### UPLOAD ####### | ||
################################# | ||
|
||
####### Upload Staging and Release ####### | ||
upload: | ||
stage: upload | ||
|
||
before_script: | ||
- eval `python3 check-version-tag.py ${CI_COMMIT_TAG}` | ||
|
||
script: | ||
- DATE="$(cat tmp/date.txt)" | ||
- TIME="$(cat tmp/time.txt)" | ||
- PKG_NAME="$(cat tmp/pkg_name.txt)" | ||
- PKG_NAME_PIO="$(cat tmp/pkg_name_pio.txt)" | ||
- TARGET_PATH="$(cat tmp/target_path.txt)" | ||
- > | ||
if [[ ${PRE_RELEASE} == "test" ]]; then | ||
REPO_NAME=${REPO_NAME}-snapshot | ||
REPO_NAME_PIO=${REPO_NAME_PIO}-snapshot | ||
fi | ||
# Upload to Artifactory | ||
- curl -u $REPO_USR:$REPO_PWD -T tmp/$PKG_NAME.tar.bz2 "${REPO_BASE_URL}/artifactory/${REPO_NAME}/${TARGET_PATH}/${PKG_NAME}.tar.bz2" | ||
- curl -u $REPO_USR:$REPO_PWD -T tmp/$PKG_NAME_PIO.tar.bz2 "${REPO_BASE_URL}/artifactory/${REPO_NAME_PIO}/${TARGET_PATH}/${PKG_NAME_PIO}.tar.bz2" | ||
|
||
only: | ||
- tags | ||
|
||
except: | ||
- master | ||
- branches | ||
|
||
################################# | ||
####### CLEANUP ####### | ||
################################# | ||
|
||
####### Cleanup Job ####### | ||
cleanup: | ||
stage: cleanup | ||
|
||
variables: | ||
GIT_STRATEGY: none | ||
|
||
script: | ||
- echo "Cleaning up" | ||
- rm -rf tmp/ | ||
|
||
when: always | ||
|
||
only: | ||
- tags | ||
|
||
except: | ||
- master | ||
- branches |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "libraries/Adafruit_nRFCrypto"] | ||
path = libraries/Adafruit_nRFCrypto | ||
url = https://github.com/adafruit/Adafruit_nRFCrypto.git | ||
[submodule "libraries/Adafruit_TinyUSB_Arduino"] | ||
path = libraries/Adafruit_TinyUSB_Arduino | ||
url = https://github.com/adafruit/Adafruit_TinyUSB_Arduino.git |
This file contains 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
Oops, something went wrong.