cci: add release_build support (#914)

This commit is contained in:
dman776 2023-08-24 20:21:12 -05:00 committed by GitHub
parent 5bd55e395a
commit 338faefabb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 72 additions and 0 deletions

View File

@ -8,6 +8,10 @@ parameters:
type: enum
enum: [no_action, nightly_build, manual_build, release_build]
default: no_action
release_version:
type: string
default: "NO_RELEASE_VERSION_SET"
######################################
# REUSABLE COMMANDS
@ -24,6 +28,18 @@ commands:
sed -i "s/NoCall/${BUILD_DATE}/g" ${MY_WORKING_DIRECTORY}/config.mk
sed -i "s/MAKE_ARGS=-j3/MAKE_ARGS=-j${DASH_J_VALUE}/g" ${MY_WORKING_DIRECTORY}/config.mk
cat ${MY_WORKING_DIRECTORY}/config.mk
update_config_mk_release:
description: "Update variables in config.mk for release"
steps:
- run:
name: Update Config.mk Release
command: |
export MY_WORKING_DIRECTORY=`pwd`
sed -i "s/FW_VERSION=$(PRIVATE_BUILD_VERSION)-$(GIT_COMMIT)/FW_VERSION=$(PRIVATE_BUILD_VERSION)/g" ${MY_WORKING_DIRECTORY}/Makefile
sed -i "s/NoCall/<< pipeline.parameters.release_version >>/g" ${MY_WORKING_DIRECTORY}/config.mk
sed -i "s/MAKE_ARGS=-j3/MAKE_ARGS=-j${DASH_J_VALUE}/g" ${MY_WORKING_DIRECTORY}/config.mk
cat ${MY_WORKING_DIRECTORY}/config.mk
######################################
# JOBS
@ -76,6 +92,53 @@ jobs:
name: Deploy Files
command: scp -o StrictHostKeyChecking=no ~/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} ${SSH_USER}@${SSH_HOST}:${TARGET_DIR}
build_release:
resource_class: large
docker:
- image: arednmesh/builder
steps:
- checkout
- update_config_mk_release
- run:
name: Build ath79/generic
command: make MAINTARGET=ath79 SUBTARGET=generic
no_output_timeout: 2h
- run:
name: Build ath79/tiny
command: make MAINTARGET=ath79 SUBTARGET=tiny
no_output_timeout: 1h
- run:
name: Build ath79/mikrotik
command: make MAINTARGET=ath79 SUBTARGET=mikrotik
no_output_timeout: 1h
- run:
name: Build ath79/mikrotik/ath10k
command: make MAINTARGET=ath79 SUBTARGET=mikrotik ALTTARGET=ath10k
no_output_timeout: 1h
- run:
name: Build ath79/mikrotik/nand
command: make MAINTARGET=ath79 SUBTARGET=mikrotik ALTTARGET=nand
no_output_timeout: 1h
- run:
name: Build ath79/nand
command: make MAINTARGET=ath79 SUBTARGET=nand
no_output_timeout: 1h
- run:
name: Build ipq40xx/mikrotik
command: make MAINTARGET=ipq40xx SUBTARGET=mikrotik
no_output_timeout: 2h
- run:
name: Build x64/64
command: make MAINTARGET=x86 SUBTARGET=64
no_output_timeout: 2h
- run:
name: Compress build files
command: tar -cjf ~/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} -C ${MY_WORKING_DIRECTORY}/${ARTIFACTS_DIR} .
- run:
name: Deploy Files
command: scp -o StrictHostKeyChecking=no ~/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} ${SSH_USER}@${SSH_HOST}:${TARGET_DIR}
check2build:
machine:
image: ubuntu-2004:2023.02.1
@ -212,3 +275,12 @@ workflows:
- save_build_info:
requires:
- process_artifacts_nightly
release_build:
when:
equal: [ release_build, << pipeline.parameters.action >> ]
jobs:
- build_release
- save_build_info:
requires:
- build_release