sforkowany z mirror/meshtastic-firmware
CI/CD for building on GitLab instance (#1028)
This yml is basically a wrapper for build-all.sh that makes sure the submodules are checked out and pushes a release package to the gitlab registry. Not needed for building on github! Co-authored-by: Ben Meadors <benmmeadors@gmail.com>1.2-legacy
rodzic
2818dfc948
commit
bea9dfff38
|
@ -0,0 +1,50 @@
|
||||||
|
image: python:latest
|
||||||
|
|
||||||
|
variables:
|
||||||
|
# make sure GitLab check out submodules
|
||||||
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- buildall
|
||||||
|
- upload
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: buildall
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
# we need zip later for packaging
|
||||||
|
- "apt update;apt -y install zip"
|
||||||
|
- "pip install -U platformio"
|
||||||
|
|
||||||
|
script:
|
||||||
|
# clean up residues from previous run
|
||||||
|
- rm -rf release
|
||||||
|
- bin/build-all.sh
|
||||||
|
|
||||||
|
# This is for my local environment, if your runners are tagged differently, modify or remove
|
||||||
|
tags:
|
||||||
|
- dockerized
|
||||||
|
|
||||||
|
# The files which are to be made available in GitLab
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- release/archive/firmware*.zip
|
||||||
|
|
||||||
|
|
||||||
|
upload:
|
||||||
|
image: curlimages/curl:latest
|
||||||
|
|
||||||
|
stage: upload
|
||||||
|
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/master"
|
||||||
|
cd release/archive
|
||||||
|
for f in *.zip; do
|
||||||
|
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ${f} ${PACKAGE_REGISTRY_URL}/${f}
|
||||||
|
done
|
||||||
|
echo 'Package uploaded!'
|
||||||
|
|
||||||
|
# This is for my local environment, if your runners are tagged differently, modify or remove
|
||||||
|
tags:
|
||||||
|
- dockerized
|
Ładowanie…
Reference in New Issue