代码拉取完成,页面将自动刷新
stages:
- build
- private_deploy
- test
- public_deploy
- release_stage1
- release_submit
image: $CI_DOCKER_REGISTRY/esp32-toolchain
variables:
#
# System environment
# Common parameters for the 'make' during CI tests
MAKEFLAGS: "-j4 --no-keep-going"
# Binutils configure options
BINUTILS_CONFIGURE_OPTS: "--disable-doc --disable-gdb --disable-libdecnumber --disable-readline --disable-sim"
# GitHub Tool options
GITHUB_USER: "${GH_USER}"
GITHUB_REPO: "${GH_REPO}"
GITHUB_TOKEN: "${GH_TOKEN}"
#
# CI settings
GIT_SUBMODULE_STRATEGY: none
#
# Customization of jobs
DIST_INSTALLED_DIR: "${CONF_TARGET}-binutils"
ARCHIVE_TOOL: "tar czf"
UNARCHIVE_TOOL: "tar xf"
ARCHIVE_EXT: "tar.gz"
GH_TOOL_NAME: github-release
GH_TOOL: "./dist/${GH_TOOL_NAME}"
RELEASE_DESC: "New release"
.use_ci_tools: &use_ci_tools |
curl -sSL ${CIT_LOADER_URL} -o cit_loader.sh && sh cit_loader.sh
source citools/import_functions
before_script:
- *use_ci_tools
.get_release_name: &get_release_name |
PREFX=${CI_PROJECT_NAME}
tmpVER=$( tmpTAG=$(git describe --tags | grep -E "^v[0-9]") && ( echo $tmpTAG | sed -n -r "s|^v(.*)|\1|gp" ) || echo "" )
if [ ! $tmpVER ]; then
tmpVER=$( tmpTAG=$(git describe --tags | grep -E "^${PREFX}-") && ( echo $tmpTAG | sed -n -r "s|^${PREFX}-(.*)|\1|gp" ) || echo "" )
if [ ! $tmpVER ]; then
tmpVER=$(git describe --abbrev=6)
fi
fi
REL_VERSION=$tmpVER
REL_NAME="binutils-${CONF_TARGET%-elf}-${PLATFORM_NAME}-${REL_VERSION}"
ARCHIVE_NAME=${REL_NAME}.${ARCHIVE_EXT}
echo "PLATFORM_NAME: $PLATFORM_NAME"
echo "REL_VERSION: $REL_VERSION"
echo "REL_NAME: $REL_NAME"
echo "ARCHIVE_NAME: $ARCHIVE_NAME"
.set_displayed_version: &set_displayed_version |
# Use the REL_VERSION for the "--version" text
# The substitution will be made in the 'make' step
export ESP_VERSION=${REL_VERSION}
sed -ri 's/(.*)(bfd_version_string=)(.*)( ;\\)$/\1\2"\\"$(ESP_VERSION)\\""\4/' bfd/Makefile.in
.dist_archive: &dist_archive |
${ARCHIVE_TOOL} ${ARCHIVE_NAME} ${DIST_INSTALLED_DIR}
mkdir -p dist
mv ${ARCHIVE_NAME} dist/
echo "${ARCHIVE_NAME}" > dist/file_${PLATFORM_NAME}_${CONF_TARGET}
.add_gh_key_remote: &add_gh_key_remote |
cit_add_ssh_key "${GH_PUSH_KEY}"
git remote remove github || true
git remote add github ${GH_PUSH_REPO}
.gh_getting_tool: &gh_getting_tool |
# do not download if it was installed locally
LOCAL_TOOL_PATH=$(command -v ${GH_TOOL_NAME}) && cp ${LOCAL_TOOL_PATH} . || wget --no-verbose -O $GH_TOOL_NAME $GH_TOOL_URL
chmod +x ./$GH_TOOL_NAME
.gh_upload_archive: &gh_upload_archive |
ARCHIVE_NAME=$(cat dist/file_${PLATFORM_NAME}_${CONF_TARGET})
echo Release ${GH_REL_TAG}, file ${ARCHIVE_NAME}
${GH_TOOL} upload -s ${GITHUB_TOKEN} --tag ${GH_REL_TAG} -f dist/${ARCHIVE_NAME} -n ${ARCHIVE_NAME}
# prefix should be like a $CI_PROJECT_NAME, but we cannot use variable here
.release_tag_filter: &release_tag_filter
only:
- /^v[0-9].*$/
- /^binutils-esp32ulp-.*$/
.manual_action: &manual_action
when: manual
allow_failure: true
.configure_native: &configure_native |
MAKEFLAGS= ./configure \
--target=${CONF_TARGET} \
--prefix="${PWD}/${DIST_INSTALLED_DIR}" \
${BINUTILS_CONFIGURE_OPTS}
.configure_crossbuild: &configure_crossbuild |
MAKEFLAGS= ./configure \
--host=${CONF_HOST} \
--target=${CONF_TARGET} \
--prefix="${PWD}/${DIST_INSTALLED_DIR}" \
${BINUTILS_CONFIGURE_OPTS}
.after_configure: &after_configure |
echo "MAKEINFO = :" >> Makefile
.build_dist: &build_dist |
make
MAKEFLAGS= make install-strip
# Builds
.build_template: &build_template
stage: build
artifacts:
paths:
- dist
- config.log
when: always
expire_in: 6 weeks
after_script:
# Just for cleaning space, no other causes. Don't remove artifacts
- git add -f dist config.log
- git clean -ffxdq
.build_template_linux: &build_template_linux
<<: *build_template
image: $CI_DOCKER_REGISTRY/esp32-toolchain
script:
- *get_release_name
- *set_displayed_version
- *configure_native
- *after_configure
- *build_dist
- *dist_archive
esp32_lin_amd64:
<<: *build_template_linux
variables:
PLATFORM_NAME: "linux-amd64"
CONF_TARGET: "esp32ulp-elf"
esp32s2_lin_amd64:
<<: *build_template_linux
variables:
PLATFORM_NAME: "linux-amd64"
CONF_TARGET: "esp32s2ulp-elf"
.build_template_crossbuild: &build_template_crossbuild
<<: *build_template
script:
- *get_release_name
- *set_displayed_version
- *configure_crossbuild
- *after_configure
- *build_dist
- *dist_archive
esp32_win:
<<: *build_template_crossbuild
image: $CI_DOCKER_REGISTRY/esp32-toolchain-win-cross
variables:
PLATFORM_NAME: "win32"
ARCHIVE_TOOL: "zip -r"
ARCHIVE_EXT: "zip"
CC: "i686-w64-mingw32-gcc"
CXX: "i686-w64-mingw32-g++"
CONF_HOST: "i686-w64-mingw32"
CONF_TARGET: "esp32ulp-elf"
esp32s2_win:
<<: *build_template_crossbuild
image: $CI_DOCKER_REGISTRY/esp32-toolchain-win-cross
variables:
PLATFORM_NAME: "win32"
ARCHIVE_TOOL: "zip -r"
ARCHIVE_EXT: "zip"
CC: "i686-w64-mingw32-gcc"
CXX: "i686-w64-mingw32-g++"
CONF_HOST: "i686-w64-mingw32"
CONF_TARGET: "esp32s2ulp-elf"
esp32_macos:
<<: *build_template_crossbuild
image: $CI_DOCKER_REGISTRY/esp32-toolchain-macos-cross
variables:
PLATFORM_NAME: "macos"
CC: "x86_64-apple-darwin12-clang"
CXX: "x86_64-apple-darwin12-clang++"
CONF_HOST: "x86_64-apple-darwin12"
CONF_TARGET: "esp32ulp-elf"
esp32s2_macos:
<<: *build_template_crossbuild
image: $CI_DOCKER_REGISTRY/esp32-toolchain-macos-cross
variables:
PLATFORM_NAME: "macos"
CC: "x86_64-apple-darwin12-clang"
CXX: "x86_64-apple-darwin12-clang++"
CONF_HOST: "x86_64-apple-darwin12"
CONF_TARGET: "esp32s2ulp-elf"
esp32_lin_armel:
<<: *build_template_crossbuild
image: $CI_DOCKER_REGISTRY/esp32-toolchain-arm-cross
variables:
PLATFORM_NAME: "linux-armel"
CONF_HOST: "arm-linux-gnueabi"
CONF_TARGET: "esp32ulp-elf"
esp32s2_lin_armel:
<<: *build_template_crossbuild
image: $CI_DOCKER_REGISTRY/esp32-toolchain-arm-cross
variables:
PLATFORM_NAME: "linux-armel"
CONF_HOST: "arm-linux-gnueabi"
CONF_TARGET: "esp32s2ulp-elf"
# Tests
.test_template: &test_template
stage: test
image: $CI_DOCKER_REGISTRY/esp32-toolchain
artifacts:
paths:
- ${TEST_CMP_DIR}
expire_in: 6 weeks
after_script:
- git add -f ${TEST_CMP_DIR}
- git clean -ffxdq
script:
- ARCHIVE_NAME=$(cat dist/file_${PLATFORM_NAME}_${CONF_TARGET})
- ${UNARCHIVE_TOOL} dist/${ARCHIVE_NAME}
- ${TEST_SCRIPT} ${TEST_PREFIX}
- cd ${TEST_CMP_DIR}
- git diff --exit-code -- . || (echo 'Differences found. Please check changes and commit new check files.'; exit 1)
- echo "Compare test done"
esp32_lin_test:
<<: *test_template
dependencies:
- esp32_lin_amd64
variables:
PLATFORM_NAME: "linux-amd64"
CONF_TARGET: "esp32ulp-elf"
TEST_PREFIX: "./esp32ulp-elf-binutils/bin/esp32ulp-elf-"
TEST_SCRIPT: "./gas/testsuite/gas/esp32ulp/check_all.sh"
TEST_CMP_DIR: "gas/testsuite/gas/esp32ulp/compare"
esp32s2_lin_test:
<<: *test_template
dependencies:
- esp32s2_lin_amd64
variables:
PLATFORM_NAME: "linux-amd64"
CONF_TARGET: "esp32s2ulp-elf"
TEST_PREFIX: "./esp32s2ulp-elf-binutils/bin/esp32s2ulp-elf-"
TEST_SCRIPT: "./gas/testsuite/gas/esp32s2ulp/check_all.sh"
TEST_CMP_DIR: "gas/testsuite/gas/esp32s2ulp/compare"
esp32_armel_test:
<<: *test_template
image: $CI_DOCKER_REGISTRY/rpi-esp-idf-env:1
tags:
- linux_arm
dependencies:
- esp32_lin_armel
variables:
# Just for size optimization on RPi
GIT_DEPTH: 5
PLATFORM_NAME: "linux-armel"
CONF_TARGET: "esp32ulp-elf"
TEST_PREFIX: "./esp32ulp-elf-binutils/bin/esp32ulp-elf-"
TEST_SCRIPT: "./gas/testsuite/gas/esp32ulp/check_all.sh"
TEST_CMP_DIR: "gas/testsuite/gas/esp32ulp/compare"
esp32s2_armel_test:
<<: *test_template
image: $CI_DOCKER_REGISTRY/rpi-esp-idf-env:1
tags:
- linux_arm
dependencies:
- esp32s2_lin_armel
variables:
GIT_DEPTH: 5
PLATFORM_NAME: "linux-armel"
CONF_TARGET: "esp32s2ulp-elf"
TEST_PREFIX: "./esp32s2ulp-elf-binutils/bin/esp32s2ulp-elf-"
TEST_SCRIPT: "./gas/testsuite/gas/esp32s2ulp/check_all.sh"
TEST_CMP_DIR: "gas/testsuite/gas/esp32s2ulp/compare"
#
upload_to_http:
<<: *manual_action
stage: private_deploy
tags:
- deploy
variables:
GIT_STRATEGY: none
script:
- cit_add_ssh_key "${HTTP_UPLOAD_KEY}"
# List of archives in dist/
- FILES=$(find dist -name file_\* -exec cat {} \+ | sort -u)
- cd dist
- scp ${FILES} "${HTTP_UPLOAD_DIR}/ulp"
# Show info
- echo -e "\nArchives were published there:\n\n$(for n in ${FILES}; do echo "${HTTP_PUBLIC_DIR}/ulp/${n}"; done)\n"
push_master_to_github:
stage: public_deploy
only:
- master
when: on_success
dependencies: []
script:
- *add_gh_key_remote
- git push github HEAD:master
get_gh_tools:
stage: build
<<: *release_tag_filter
artifacts:
paths:
- dist
variables:
GIT_STRATEGY: none
script:
- *gh_getting_tool
- mkdir -p dist
- mv ${GH_TOOL_NAME} dist/
release_tag_draft:
stage: release_stage1
<<: *release_tag_filter
<<: *manual_action
script:
- *add_gh_key_remote
- git push --force github ${CI_COMMIT_TAG}
# release draft
- ${GH_TOOL} delete -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} || true
- ${GH_TOOL} release -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}" --draft
- GH_REL_TAG=${CI_COMMIT_TAG}
# Upload archives
- PLATFORM_NAME="linux-amd64"
- CONF_TARGET="esp32ulp-elf"
- *gh_upload_archive
- PLATFORM_NAME="linux-amd64"
- CONF_TARGET="esp32s2ulp-elf"
- *gh_upload_archive
- PLATFORM_NAME="win32"
- CONF_TARGET="esp32ulp-elf"
- *gh_upload_archive
- PLATFORM_NAME="win32"
- CONF_TARGET="esp32s2ulp-elf"
- *gh_upload_archive
- PLATFORM_NAME="macos"
- CONF_TARGET="esp32ulp-elf"
- *gh_upload_archive
- PLATFORM_NAME="macos"
- CONF_TARGET="esp32s2ulp-elf"
- *gh_upload_archive
- PLATFORM_NAME="linux-armel"
- CONF_TARGET="esp32ulp-elf"
- *gh_upload_archive
- PLATFORM_NAME="linux-armel"
- CONF_TARGET="esp32s2ulp-elf"
- *gh_upload_archive
Release_tag_submit:
stage: release_submit
<<: *release_tag_filter
<<: *manual_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} edit -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}"
Pre-Release_tag_submit:
stage: release_submit
<<: *release_tag_filter
<<: *manual_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} edit -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} --description "${RELEASE_DESC}" --pre-release
Delete_tag_release:
stage: release_submit
<<: *release_tag_filter
<<: *manual_action
dependencies:
- get_gh_tools
variables:
GIT_STRATEGY: none
script:
- ${GH_TOOL} delete -s ${GITHUB_TOKEN} --tag ${CI_COMMIT_TAG} || true
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。