CI: Build `git describe` versioned snapshot tarballs

This:
 - modifies `configure.ac` to get a version number courtesy of `git`
   when `autoconf` is run
 - runs a `make dist` when all compilation targets succeed
 - makes the resulting tarball available as a build artifact
 - renames the various pipeline stages
merge-requests/1/head
Olaf Meeuwissen 2017-06-17 12:38:21 +09:00
rodzic a06e9a4075
commit e7d9779dfc
2 zmienionych plików z 42 dodań i 15 usunięć

Wyświetl plik

@ -9,42 +9,69 @@ variables:
CONFIGURE_FULL: "--with-usb --enable-avahi --enable-pnm-backend" CONFIGURE_FULL: "--with-usb --enable-avahi --enable-pnm-backend"
stages: stages:
- lint - prepare
- build - compile
- archive
lint: prepare:
stage: lint image: $REGISTRY_HUB:debian-8-base
stage: prepare
script: script:
- find -path ./.git -prune -o -type f | xargs tools/style-check.sh - find -path ./.git -prune -o -type f | xargs tools/style-check.sh
- sed -i '/^AC_INIT/s/,.*/,m4_esyscmd_s([git describe --dirty]),/' configure.ac
- autoconf --force
artifacts:
paths:
- configure
expire_in: 1 day
.build_template: &build_definition .compile_template: &compile_definition
stage: build stage: compile
script: script:
- ./configure $CONFIGURE_OPTS - ./configure $CONFIGURE_OPTS
- make -j2 -k $MAKE_FLAGS - make -j2 -k $MAKE_FLAGS
build:debian-8-mini: compile:debian-8-mini:
image: $REGISTRY_HUB:debian-8-mini image: $REGISTRY_HUB:debian-8-mini
variables: variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI" CONFIGURE_OPTS: "$CONFIGURE_MINI"
MAKE_FLAGS: "CFLAGS=-Werror" MAKE_FLAGS: "CFLAGS=-Werror"
<<: *build_definition <<: *compile_definition
build:debian-8-full: compile:debian-8-full:
image: $REGISTRY_HUB:debian-8-full image: $REGISTRY_HUB:debian-8-full
variables: variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
MAKE_FLAGS: "CFLAGS=-Werror" MAKE_FLAGS: "CFLAGS=-Werror"
<<: *build_definition <<: *compile_definition
cache:
untracked: true
artifacts:
paths:
- configure
expire_in: 1 day
build:alpine-3.6-musl: compile:alpine-3.6-musl:
image: $REGISTRY_HUB:alpine-3.6-musl image: $REGISTRY_HUB:alpine-3.6-musl
variables: variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
<<: *build_definition <<: *compile_definition
build:fedora-25-clang: compile:fedora-25-clang:
image: $REGISTRY_HUB:fedora-25-clang image: $REGISTRY_HUB:fedora-25-clang
variables: variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
<<: *build_definition <<: *compile_definition
archive:
stage: archive
image: $REGISTRY_HUB:debian-8-full
dependencies:
- compile:debian-8-full
before_script:
- ./config.status --quiet || ./configure "$CONFIGURE_MINI"
script:
- make dist
artifacts:
paths:
- sane-backends-*.tar.gz

Wyświetl plik

@ -27,7 +27,7 @@ AS_IF([test x = "x`echo $VERSION | sed 's/[[.0-9]]//g'`"],
[is_release=no]) [is_release=no])
V_MAJOR=`echo $VERSION | $AWK -F. '{print $1}'` V_MAJOR=`echo $VERSION | $AWK -F. '{print $1}'`
V_MINOR=`echo $VERSION | $AWK -F. '{print $2}'` V_MINOR=`echo $VERSION | $AWK -F. '{print $2}'`
V_REV=`echo $VERSION | $AWK -F. '{print $3}' | sed 's/[[^0-9]]//g'`; V_REV=`echo $VERSION | $AWK -F. '{print $3}' | sed 's/^\([[0-9]]*\).*/\1/'`;
AC_DEFINE_UNQUOTED(SANE_DLL_V_MAJOR, $V_MAJOR, [SANE DLL major number]) AC_DEFINE_UNQUOTED(SANE_DLL_V_MAJOR, $V_MAJOR, [SANE DLL major number])
AC_DEFINE_UNQUOTED(SANE_DLL_V_MINOR, $V_MINOR, [SANE DLL minor number]) AC_DEFINE_UNQUOTED(SANE_DLL_V_MINOR, $V_MINOR, [SANE DLL minor number])