Merge branch '24-add-musl-builds' into 'main'

Fix CI

See merge request root/fileserver!12
This commit is contained in:
Mutzi 2022-09-04 11:38:22 +00:00
commit 033a0aca2e

View File

@ -6,6 +6,10 @@ stages:
build_backend_glibc:
stage: build
image: reg.gitlab.mattv.de/root/docker-images/ubuntu_build_base:latest
cache:
key: backend_glibc
paths:
- vcpkg_cache
script:
- SRC="$PWD"
- TMP=$(mktemp -d)
@ -17,10 +21,6 @@ build_backend_glibc:
- VCPKG_DEFAULT_BINARY_CACHE=$SRC/vcpkg_cache cmake -B build -S backend -DCMAKE_TOOLCHAIN_FILE=$TMP/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release
- cmake --build build
- cp build/backend server
cache:
key: backend_glibc
paths:
- vcpkg_cache
artifacts:
paths:
- server
@ -28,6 +28,10 @@ build_backend_glibc:
build_backend_muslc:
stage: build
image: reg.gitlab.mattv.de/root/docker-images/alpine_build_base:latest
cache:
key: backend_muslc
paths:
- vcpkg_cache
script:
- SRC="$PWD"
- TMP=$(mktemp -d)
@ -39,10 +43,6 @@ build_backend_muslc:
- VCPKG_FORCE_SYSTEM_BINARIES=1 VCPKG_DEFAULT_BINARY_CACHE=$SRC/vcpkg_cache cmake -B build -S backend -DCMAKE_TOOLCHAIN_FILE=$TMP/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release
- cmake --build build
- cp build/backend server
cache:
key: backend_muslc
paths:
- vcpkg_cache
artifacts:
paths:
- server
@ -106,12 +106,8 @@ upload_assets:
rules:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "linux-x64-glibc.tar" "${PACKAGE_REGISTRY_URL}/linux-x64-glibc.tar"
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "linux-x64-muslc.tar" "${PACKAGE_REGISTRY_URL}/linux-x64-muslc.tar"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file linux-x64-glibc.tar "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-glibc/$CI_COMMIT_TAG/linux-x64-glibc.tar"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file linux-x64-muslc.tar "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-muslc/$CI_COMMIT_TAG/linux-x64-muslc.tar"'
create_release:
stage: release
@ -121,7 +117,15 @@ create_release:
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"linux-x64-glibc.tar\",\"url\":\"${PACKAGE_REGISTRY_URL}/linux-x64-glibc.tar\"}" \
--assets-link "{\"name\":\"linux-x64-muslc.tar\",\"url\":\"${PACKAGE_REGISTRY_URL}/linux-x64-muslc.tar\"}"
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: '$CI_COMMIT_TAG'
description: 'Release $CI_COMMIT_TAG'
assets:
links:
- name: 'linux-x64-glibc.tar'
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-glibc/$CI_COMMIT_TAG/linux-x64-glibc.tar'
link_type: package
- name: 'linux-x64-muslc.tar'
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-muslc/$CI_COMMIT_TAG/linux-x64-muslc.tar'
link_type: package