Avoid artifacting untarred dist folders and add package publication

This commit is contained in:
Tristan 2022-06-06 08:51:31 +01:00
parent 77fea45630
commit 2bbb15c003
No known key found for this signature in database
GPG Key ID: BDDFC4A0651ACDE4
5 changed files with 71 additions and 14 deletions

View File

@ -19,30 +19,33 @@ lua:
stage: dependencies
script: make -C deps/lua
artifacts:
expire_in: 14 days
paths: [ "deps/lua/dist" ]
expire_in: 7 days
paths: [ "deps/lua/lua-dist.tar.gz" ]
pcre2:
<<: *build-job
stage: dependencies
script: make -C deps/pcre2
artifacts:
expire_in: 14 days
paths: [ "deps/pcre2/dist" ]
expire_in: 7 days
paths: [ "deps/pcre2/pcre2-dist.tar.gz" ]
quictls:
<<: *build-job
stage: dependencies
script: make -C deps/quictls
artifacts:
expire_in: 14 days
paths: [ "deps/quictls/dist", "deps/quictls/quictls-*-dist.tar.gz" ]
expire_in: 7 days
paths: [ "deps/quictls/quictls-dist.tar.gz" ]
haproxy:
<<: *build-job
stage: build
script:
- apt install -y --no-install-recommends -qq git
- apt install -y --no-install-recommends -qq bzip2 git
- mkdir deps/lua/dist && tar -C deps/lua/dist -xf deps/lua/lua-dist.tar.gz
- mkdir deps/pcre2/dist && tar -C deps/pcre2/dist -xf deps/pcre2/pcre2-dist.tar.gz
- mkdir deps/quictls/dist && tar -C deps/quictls/dist -xf deps/quictls/quictls-dist.tar.gz
- make -C haproxy
needs:
- job: lua
@ -52,8 +55,8 @@ haproxy:
- job: quictls
artifacts: true
artifacts:
expire_in: 14 days
paths: [ "haproxy/dist", "haproxy/haproxy-*-dist.tar.gz" ]
expire_in: 7 days
paths: [ "haproxy/dist", "haproxy/haproxy-dist.tar.gz" ]
docker:
stage: publish
@ -112,3 +115,47 @@ docker:
artifacts: true
- job: haproxy
artifacts: true
pkg:quictls:
image: docker.io/curlimages/curl:latest
stage: publish
needs:
- job: quictls
artifacts: true
script: |
set -eu
PKG_VER=1.1.1o
if [ "$CI_COMMIT_REF_NAME" != "$CI_DEFAULT_BRANCH" ]; then
export PKG_VER="branch-$CI_COMMIT_REF_SLUG"
echo "Git reference $CI_COMMIT_REF_NAME is not the default branch. Setting version to $PKG_VER"
fi
curl \
-H"JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file "deps/quictls/quictls-dist.tar.gz" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/quictls/$PKG_VER/quictls.tar.gz"
variables:
GIT_STRATEGY: none
pkg:haproxy:
image: docker.io/curlimages/curl:latest
stage: publish
needs:
- job: haproxy
artifacts: true
script: |
set -eu
PKG_VER=2.6.0
if [ "$CI_COMMIT_REF_NAME" != "$CI_DEFAULT_BRANCH" ]; then
export PKG_VER="branch-$CI_COMMIT_REF_SLUG"
echo "Git reference $CI_COMMIT_REF_NAME is not the default branch. Setting version to $PKG_VER"
fi
curl \
-H"JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file "haproxy/haproxy-dist.tar.gz" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/haproxy/$PKG_VER/haproxy.tar.gz"
variables:
GIT_STRATEGY: none

7
deps/lua/Makefile vendored
View File

@ -4,8 +4,9 @@ LUA_TARBALL = lua-$(LUA_VERSION).tar.gz
LUA_BUILDIR = src
LUA_DESTDIR = dist
LUA_DESTDIR_ABS = $(shell realpath $(LUA_DESTDIR))
LUA_ARCHIVE = lua-dist.tar.gz
all: $(LUA_BUILDIR) $(LUA_DESTDIR)
all: $(LUA_BUILDIR) $(LUA_DESTDIR) $(LUA_ARCHIVE)
$(LUA_BUILDIR):
@if ! [ -d "$(LUA_BUILDIR)" ]; then mkdir -v "$(LUA_BUILDIR)"; fi
@ -21,9 +22,13 @@ $(LUA_DESTDIR): build
if ! [ -d "$(LUA_DESTDIR)" ]; then mkdir -v "$(LUA_DESTDIR)"; fi
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) install INSTALL_TOP="$(LUA_DESTDIR_ABS)"
$(LUA_ARCHIVE): $(LUA_DESTDIR)
tar -C "$(LUA_DESTDIR)" -cjf "$(LUA_ARCHIVE)" $$(ls -1 $(LUA_DESTDIR))
clean:
rm -rf "$(LUA_BUILDIR)"
rm -rf "$(LUA_DESTDIR)"
rm -fv "$(LUA_TARBALL)"
rm -fv "$(LUA_ARCHIVE)"
.PHONY: clean build

9
deps/pcre2/Makefile vendored
View File

@ -4,6 +4,7 @@ PCRE2_TARBALL = pcre2-$(PCRE2_VERSION).tar.gz
PCRE2_BUILDIR = src
PCRE2_DESTDIR = dist
PCRE2_DESTDIR_ABS = $(shell realpath $(PCRE2_DESTDIR))
PCRE2_ARCHIVE = pcre2-dist.tar.gz
all: build dist
@ -18,13 +19,17 @@ build: $(PCRE2_BUILDIR)/pcre2-$(PCRE2_VERSION).tar.gz
if [ -f "$(PCRE2_BUILDIR)/CmakeCache.txt" ]; then rm -v "$(PCRE2_BUILDIR)/CmakeCache.txt"; fi
cd "$(PCRE2_BUILDIR)" && cmake -DPCRE2_STATIC_PIC=ON -DPCRE2_SUPPORT_JIT=ON -DCMAKE_INSTALL_PREFIX="$(PCRE2_DESTDIR_ABS)" . && make
dist: build
$(PCRE2_DESTDIR): build
if ! [ -d "$(PCRE2_DESTDIR)" ]; then mkdir -v "$(PCRE2_DESTDIR)"; fi
cd "$(PCRE2_BUILDIR)" && make install
$(PCRE2_ARCHIVE): $(PCRE2_DESTDIR)
tar -C "$(PCRE2_DESTDIR)" -cjf "$(PCRE2_ARCHIVE)" $$(ls -1 $(PCRE2_DESTDIR))
clean:
rm -rf "$(PCRE2_BUILDIR)"
rm -rf "$(PCRE2_DESTDIR)"
rm -fv "$(PCRE2_TARBALL)"
rm -fv "$(PCRE2_ARCHIVE)"
.PHONY: clean build dist
.PHONY: clean build

View File

@ -4,7 +4,7 @@ QUICTLS_TARBALL = quictls-$(QUICTLS_VERSION).tar.gz
QUICTLS_BUILDIR = src
QUICTLS_DESTDIR = dist
QUICTLS_DESTDIR_ABS = $(shell realpath $(QUICTLS_DESTDIR))
QUICTLS_ARCHIVE = quictls-$(QUICTLS_VERSION)-dist.tar.gz
QUICTLS_ARCHIVE = quictls-dist.tar.gz
all: $(QUICTLS_DESTDIR) $(QUICTLS_ARCHIVE)

View File

@ -4,7 +4,7 @@ HAPROXY_REPOSRC = http://git.haproxy.org/git/haproxy-$(HAPROXY_VERSION).git
HAPROXY_BUILDIR = src
HAPROXY_DESTDIR = dist
HAPROXY_DESTDIR_ABS = $(shell realpath $(HAPROXY_DESTDIR))
HAPROXY_ARCHIVE = haproxy-$(HAPROXY_VERSION)-dist.tar.gz
HAPROXY_ARCHIVE = haproxy-dist.tar.gz
DEP_ROOT_LUA = ../deps/lua
DEP_ROOT_PCRE2 = ../deps/pcre2