-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
57 lines (53 loc) · 1.9 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
stages:
- build
- deploy
build-linux:
stage: build
image: $CI_DOCKER_REGISTRY/qemu-build:5
tags:
- build
- amd64
artifacts:
paths:
- dist/esp-qemu-*.tar.bz2
- dist/archive_name_*
expire_in: 1 week
parallel:
matrix:
- PLATFORM: [x86_64-linux-gnu]
TARGET: [riscv32-linux-user, xtensa-softmmu, riscv32-softmmu]
script:
- ./configure --prefix=/opt/qemu --target-list=${TARGET} --extra-cflags=-Werror --disable-capstone --disable-vnc --disable-sdl --disable-gtk --enable-gcrypt --enable-slirp
- ninja -C build install
- find /opt/qemu/share/qemu -maxdepth 1 -mindepth 1 -not -name 'esp*.bin' -exec rm -rf {} \;
- mkdir -p dist
- DIST_DIR=${PWD}/dist
- VERSION=${CI_COMMIT_TAG:-""}
- VERSION=${VERSION#"esp-v"} # remove prefix in tags like `esp-v7.1.0_20221221`
- VERSION=${VERSION#"esp-"} # remove prefix in tags like `esp-develop-20221221`
- VERSION=${VERSION//"-"/"_"} # replace dashes with underscores in the version
- VERSION=${VERSION:-${CI_COMMIT_SHORT_SHA}}
- export ARCHIVE_NAME=esp-qemu-${TARGET}-${VERSION}-${PLATFORM}.tar.bz2
- cd /opt
- tar cjvf ${DIST_DIR}/${ARCHIVE_NAME} qemu
- echo $ARCHIVE_NAME >${DIST_DIR}/archive_name_${TARGET}_${PLATFORM}
upload_to_http:
image: espressif/scp
stage: deploy
tags:
- deploy
- shiny
when: manual
allow_failure: true
variables:
# don't use "GIT_STRATEGY: none", because we need cleaning old artifacts in 'dist/' that came from previous pipelines
SSH_KEY: "$HTTP_UPLOAD_KEY" # used inside 'espressif/scp'
script:
# List of archives in dist/
- FILES=$(find dist -name archive_name_\* -exec cat {} \+)
- cd dist
- scp ${FILES} ${HTTP_UPLOAD_DIR}
# Show info
- /bin/ls -l ${FILES}
- sha256sum ${FILES}
- echo -e "\nArchives were published there:\n\n$(for n in ${FILES}; do echo "${HTTP_PUBLIC_DIR}/${n}"; done)\n"