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: build_backend_glibc:
stage: build stage: build
image: reg.gitlab.mattv.de/root/docker-images/ubuntu_build_base:latest image: reg.gitlab.mattv.de/root/docker-images/ubuntu_build_base:latest
cache:
key: backend_glibc
paths:
- vcpkg_cache
script: script:
- SRC="$PWD" - SRC="$PWD"
- TMP=$(mktemp -d) - 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 - 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 - cmake --build build
- cp build/backend server - cp build/backend server
cache:
key: backend_glibc
paths:
- vcpkg_cache
artifacts: artifacts:
paths: paths:
- server - server
@ -28,6 +28,10 @@ build_backend_glibc:
build_backend_muslc: build_backend_muslc:
stage: build stage: build
image: reg.gitlab.mattv.de/root/docker-images/alpine_build_base:latest image: reg.gitlab.mattv.de/root/docker-images/alpine_build_base:latest
cache:
key: backend_muslc
paths:
- vcpkg_cache
script: script:
- SRC="$PWD" - SRC="$PWD"
- TMP=$(mktemp -d) - 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 - 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 - cmake --build build
- cp build/backend server - cp build/backend server
cache:
key: backend_muslc
paths:
- vcpkg_cache
artifacts: artifacts:
paths: paths:
- server - server
@ -106,12 +106,8 @@ upload_assets:
rules: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
script: script:
- | - '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-glibc.tar" "${PACKAGE_REGISTRY_URL}/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"'
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "linux-x64-muslc.tar" "${PACKAGE_REGISTRY_URL}/linux-x64-muslc.tar"
create_release: create_release:
stage: release stage: release
@ -121,7 +117,15 @@ create_release:
rules: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
script: script:
- | - echo "running release_job"
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \ release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
--assets-link "{\"name\":\"linux-x64-glibc.tar\",\"url\":\"${PACKAGE_REGISTRY_URL}/linux-x64-glibc.tar\"}" \ tag_name: '$CI_COMMIT_TAG'
--assets-link "{\"name\":\"linux-x64-muslc.tar\",\"url\":\"${PACKAGE_REGISTRY_URL}/linux-x64-muslc.tar\"}" 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