Commit fe686501 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig
Browse files

use split template/job definitions

parent 1d854f03
...@@ -15,216 +15,8 @@ ...@@ -15,216 +15,8 @@
### "pd-lib-builder" -> https://github.com/pure-data/pd-lib-builder/ ### "pd-lib-builder" -> https://github.com/pure-data/pd-lib-builder/
####################################################################### #######################################################################
variables: include:
PDVERSION: 0.50-2 # define job-templates:
SRCDIR: . - https://git.iem.at/pd/iem-ci/raw/master/pd-lib-builder/iem-ci.yml
IEM_CI_PKGLIBDIR: .git-ci/_build/ # turn templates into real jobs:
- https://git.iem.at/pd/iem-ci/raw/master/pd-lib-builder/pipeline-jobs.yml
#######################################################################
### script snippets
.script:fetch_localdeps: &script_fetch_localdeps
- test -e .git-ci/localdeps.win.sh || (wget -q -O .git-ci/localdeps.win.sh "https://git.iem.at/pd/iem-ci/raw/master/pd-lib-builder/localdeps.win.sh" && chmod +x .git-ci/localdeps.win.sh) || true
- test -e .git-ci/localdeps.macos.sh || (wget -q -O .git-ci/localdeps.macos.sh "https://git.iem.at/pd/iem-ci/raw/master/pd-lib-builder/localdeps.macos.sh" && chmod +x .git-ci/localdeps.macos.sh) || true
## build snippets
.script:make: &script_make
- make -C "${SRCDIR}" ${pd_extension:+extension=}${pd_extension} ${TARGETARCH:+PLATFORM=}${TARGETARCH}
.script:make_check: &script_make_check
# the 'make --version' invocation is used to detect cross-compilation
- if make --version | egrep $(echo ${TARGETARCH:-$(${CC:-cc} -dumpmachine)} | sed -e 's|-.*-|-.*-|') && make -C "${SRCDIR}" check -n ${pd_extension:+extension=}${pd_extension} ${TARGETARCH:+PLATFORM=}${TARGETARCH} >/dev/null 2>&1 ; then make -C "${SRCDIR}" check ${pd_extension:+extension=}${pd_extension} ${TARGETARCH:+PLATFORM=}${TARGETARCH}; else echo "no 'check' target or cross-compiling...skipping"; fi
.script:make_install: &script_make_install
- rm -rf "${IEM_CI_PKGLIBDIR}"
- make -C "${SRCDIR}" install ${pd_extension:+extension=}${pd_extension} ${TARGETARCH:+PLATFORM=}${TARGETARCH} DESTDIR="$(pwd)" pkglibdir="/${IEM_CI_PKGLIBDIR}/"
- rm -rf "${CI_PROJECT_NAME}"
- mv "${IEM_CI_PKGLIBDIR}/${CI_PROJECT_NAME}" .
#######################################################################
### configuration templates (to be used for snapshot and release builds)
.build:script:
stage: build
script:
- *script_make
- *script_make_check
- *script_make_install
.build:snapshot: &snapshot
except:
- tags
artifacts: &snapshot_artifacts
name: ${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME%_*}
paths:
- "${CI_PROJECT_NAME}"
expire_in: 1 week
.build:release: &release
only:
- tags
artifacts: &release_artifacts
name: ${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME%_*}
paths:
- "${CI_PROJECT_NAME}"
.build:linux: &build_linux
extends: .build:script
image: registry.git.iem.at/devtools/docker/debiancross:amd64
before_script:
- apt-get update
- rm -rf "${IEM_CI_PKGLIBDIR}"
- mkdir -p "${IEM_CI_PKGLIBDIR}"
- if [ -e .git-ci/requirements.apt ]; then apt-get install -y --no-install-recommends equivs; equivs-control "${IEM_CI_PKGLIBDIR}"/builddeps; sed -e "s|^\(Package:\) .*|\1 builddeps-${CI_PROJECT_NAME}|" -e '/^Depends/d' -i "${IEM_CI_PKGLIBDIR}"/builddeps; (echo "Depends:"" puredata-dev, puredata-core,"; cat .git-ci/requirements.apt | sed -e 's|#.*||' -e 's|[[:space:],]*$||' -e '/^$/d' -e 's|$|,|' -e 's|^[[:space:]]*| |') >> "${IEM_CI_PKGLIBDIR}"/builddeps; (cd ${IEM_CI_PKGLIBDIR}/; equivs-build ${TARGETDEBARCH:+-a} ${TARGETDEBARCH} builddeps; find . -name "*.deb" -exec dpkg -i {} + || apt-get -f install -y --no-install-recommends); else apt-get install -y --no-install-recommends build-essential puredata-dev puredata-core; fi
- rm -rf "${IEM_CI_PKGLIBDIR}"
- export PD=/usr/bin/pd
.build:linux_i386: &build_linux_i386
extends: .build:linux
image: registry.git.iem.at/devtools/docker/debiancross:i386
variables:
pd_extension: l_i386
.build:linux_armhf: &build_linux_armhf
extends: .build:linux
image: registry.git.iem.at/devtools/docker/debiancross:armhf
variables:
pd_extension: l_arm
.build:linux_arm64: &build_linux_arm64
extends: .build:linux
image: registry.git.iem.at/devtools/docker/debiancross:arm64
variables:
pd_extension: l_arm64
.build:macos: &build_macos
extends: .build:script
tags:
- osx
before_script:
- if [ -e .git-ci/requirements.brew ]; then brew bundle --no-upgrade --file=.git-ci/requirements.brew; fi
- wget -q -O Pd.tgz http://msp.ucsd.edu/Software/pd-${PDVERSION}.mac.tar.gz
- rm -rf /Applications/Pd*.app/
- tar xvf Pd.tgz -C /Applications/
- rm -f Pd.tgz
- export PD=$(find /Applications/Pd*.app/Contents/Resources/bin/ type f -name pd -print -quit)
after_script:
- *script_fetch_localdeps
- if [ -x .git-ci/localdeps.macos.sh ]; then find "${CI_PROJECT_NAME}" -type f "(" -name "*.pd_darwin" -o -name "*.so" ")" -exec .git-ci/localdeps.macos.sh {} +; fi
.build:w32: &build_w32
extends: .build:script
tags:
- windows
variables:
IEMCI_CONFIGURATIONS: mingw32
before_script:
- if [ -e .git-ci/requirements.msys2 ]; then pacman --noconfirm -S --needed $(cat .git-ci/requirements.msys2 | sed -e 's|#.*||' -e "s|@MINGW@|${MINGW_PACKAGE_PREFIX}-|"); fi
- wget -q -O Pd.zip http://msp.ucsd.edu/Software/pd-${PDVERSION}-i386.msw.zip
- rm -rf "${PROGRAMFILESX86}/pd" && mkdir -p "${PROGRAMFILESX86}/pd"
- unzip -q Pd.zip -d "${PROGRAMFILESX86}/pd"
- mv -v "${PROGRAMFILESX86}/pd"/*/* "${PROGRAMFILESX86}/pd"
- rm -f Pd.zip
- export PD="${PROGRAMFILESX86}/pd/bin/pd.com"
after_script:
- *script_fetch_localdeps
- if [ -x .git-ci/localdeps.win.sh ]; then find "${CI_PROJECT_NAME}" -type f "(" -name "*.${pd_extension:-m_i386}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec .git-ci/localdeps.win.sh {} +; fi
.build:w64: &build_w64
extends: .build:script
tags:
- windows
variables:
IEMCI_CONFIGURATIONS: mingw64
pd_extension: m_amd64
before_script:
- if [ -e .git-ci/requirements.msys2 ]; then pacman --noconfirm -S --needed $(cat .git-ci/requirements.msys2 | sed -e 's|#.*||' -e "s|@MINGW@|${MINGW_PACKAGE_PREFIX}-|"); fi
- wget -q -O Pd.zip http://msp.ucsd.edu/Software/pd-${PDVERSION}.msw.zip
- rm -rf "${PROGRAMFILES}/pd" && mkdir -p "${PROGRAMFILES}/pd"
- unzip -q Pd.zip -d "${PROGRAMFILES}/pd"
- mv -v "${PROGRAMFILES}/pd"/*/* "${PROGRAMFILES}/pd"
- rm -f Pd.zip
- export PD="${PROGRAMFILES}/pd/bin/pd.com"
after_script:
- *script_fetch_localdeps
- if [ -x .git-ci/localdeps.win.sh ]; then find "${CI_PROJECT_NAME}" -type f "(" -name "*.${pd_extension:-m_amd64}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec .git-ci/localdeps.win.sh {} +; fi
#######################################################################
### the actual jobs: (linux,macos,windows)*(release,snapshot)
### release jobs
Linux:
<<: *build_linux
<<: *release
Linuxi386:
allow_failure: true
<<: *build_linux_i386
<<: *release
LinuxARMhf:
allow_failure: true
<<: *build_linux_armhf
<<: *release
LinuxARM64:
allow_failure: true
<<: *build_linux_arm64
<<: *release
Darwin:
<<: *build_macos
<<: *release
w32:
<<: *build_w32
<<: *release
w64:
<<: *build_w64
<<: *release
### snapshot jobs
Linux_snapshot:
<<: *build_linux
<<: *snapshot
Linuxi386_snapshot:
allow_failure: true
<<: *build_linux_i386
<<: *snapshot
LinuxARMhf_snapshot:
allow_failure: true
<<: *build_linux_armhf
<<: *snapshot
LinuxARM64_snapshot:
allow_failure: true
<<: *build_linux_arm64
<<: *snapshot
Darwin_snapshot:
<<: *build_macos
<<: *snapshot
w32_snapshot:
<<: *build_w32
<<: *snapshot
w64_snapshot:
<<: *build_w64
<<: *snapshot
#######################################################################
### create deken packages and (optionally) upload them;
### if you want to automatically upload a package, you need to
### set DEKEN_USERNAME/DEKEN_PASSWORD in the CI-project settings.
### (https://git.iem.at/help/ci/variables/README#variables)
deken:
stage: deploy
image: debian:buster
only:
- tags
variables:
DEKEN_ROOT: "yes"
before_script:
- apt-get update && apt-get --no-install-recommends -y install deken git
script:
- chmod -R go-w .
# create source package
- git archive --format=tar --prefix=tmp/${CI_PROJECT_NAME}/ HEAD | tar xf -
- deken package --version="${CI_COMMIT_TAG#v}" "tmp/${CI_PROJECT_NAME}"
# create binary package
- deken package --version="${CI_COMMIT_TAG#v}" "${CI_PROJECT_NAME}"
# upload deken packages
- test -z "${DEKEN_USERNAME}" || test -z "${DEKEN_PASSWORD}" || deken upload --no-source-error ./*.dek
artifacts:
name: deken-package
paths:
- ./*.dek
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment