1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
|
stages:
- build
- deploy
include: '/.gitlab-ci-windows.yml'
python39:
image: python:3.9-alpine
when: always
stage: build
script:
- apk update
- apk add --no-interactive swig gcc git musl-dev python3-dev python3 py3-pip openssl-dev openssl py3-setuptools py3-twisted py3-docutils py3-wheel
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --break-system-packages --user -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mpip wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- python3 -mpip install --break-system-packages -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/[mM]2[cC]rypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) python3 -munittest -b -v tests.alltests.suite
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
python3:
image: python:3
when: always
stage: build
script:
- apt-get update -q -y
- apt-get install -y swig libssl-dev python3-dev python3-pip openssl python3-setuptools python3-twisted python3-pip python3-irc
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --break-system-packages --user -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mpip wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- python3 -mpip install --break-system-packages -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/[mM]2[cC]rypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) python3 -munittest -b -v tests.alltests.suite
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
alpine-32bit:
image:
name: i386/alpine
entrypoint: ["linux32"]
when: always
stage: build
script:
- apk update
- apk add --no-interactive swig gcc git musl-dev python3-dev python3 py3-pip openssl-dev openssl py3-setuptools py3-twisted py3-docutils py3-wheel
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --break-system-packages --user -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mpip wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- python3 -mpip install --break-system-packages -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/[mM]2[cC]rypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) python3 -munittest -b -v tests.alltests.suite
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
- echo "$IRC_PASS" > ~/.irc_pass && chmod 600 ~/.irc_pass
- echo "GitLab build task $CI_JOB_NAME for $REASON finished with the result $? ($CI_JOB_URL)." | .builds/irc-send irc.ergo.chat commit-bot mcepl "#m2crypto"
python3-32bit:
image:
name: i386/debian
entrypoint: ["linux32"]
when: always
stage: build
script:
- apt-get update -q -y
- apt-get install -y swig gcc git libc6-dev python3-dev python3 python3-pip libssl-dev openssl python3-setuptools python3-twisted python3-docutils python3-wheel
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --break-system-packages --user -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mpip wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- python3 -mpip install --break-system-packages -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/[mM]2[cC]rypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) python3 -munittest -b -v tests.alltests.suite
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
- echo "$IRC_PASS" > ~/.irc_pass && chmod 600 ~/.irc_pass
- echo "GitLab build task $CI_JOB_NAME for $REASON finished with the result $? ($CI_JOB_URL)." | .builds/irc-send irc.ergo.chat commit-bot mcepl "#m2crypto"
python3-doctest:
image: python:3
when: always
stage: build
script:
- apt-get update -q -y
- apt-get install -y swig libssl-dev python3-dev python3-pip openssl python3-setuptools python3-twisted python3-pip python3-irc
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --break-system-packages --user -r dev-requirements.txt
- python3 -mpip install --break-system-packages --user -r doc/requirements.txt
- ls $HOME/.local/bin
- python3 -mpip wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- python3 -mpip install --break-system-packages -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/[mM]2[cC]rypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) make -C doc/ doctest
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
- echo "$IRC_PASS" > ~/.irc_pass && chmod 600 ~/.irc_pass
- echo "GitLab build task $CI_JOB_NAME for $REASON finished with the result $? ($CI_JOB_URL)." | .builds/irc-send irc.ergo.chat commit-bot mcepl "#m2crypto"
fedora:
image: quay.io/fedora/fedora:latest
when: always
stage: build
script:
- dnf makecache
- dnf install -y @development-tools fedora-packager rpmdevtools
- dnf install -y swig python3-devel python3-pip openssl-devel openssl python3-setuptools python3-twisted openssl-devel-engine python3-irc
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --user -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mpip wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- python3 -mpip install -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/[mM]2[cC]rypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) python3 -munittest -b -v tests.alltests.suite
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
- echo "$IRC_PASS" > ~/.irc_pass && chmod 600 ~/.irc_pass
- echo "GitLab build task $CI_JOB_NAME for $REASON finished with the result $? ($CI_JOB_URL)." | .builds/irc-send irc.ergo.chat commit-bot mcepl "#m2crypto"
fedora-rawhide:
image: quay.io/fedora/fedora:rawhide
when: always
stage: build
script:
- dnf makecache
- dnf install -y @development-tools fedora-packager rpmdevtools
- dnf install -y swig python3-devel python3-pip openssl-devel openssl python3-setuptools python3-twisted openssl-devel-engine
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --break-system-packages --user -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mpip wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- python3 -mpip install --break-system-packages -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/[mM]2[cC]rypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) python3 -munittest -b -v tests.alltests.suite
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
- echo "$IRC_PASS" > ~/.irc_pass && chmod 600 ~/.irc_pass
- echo "GitLab build task $CI_JOB_NAME for $REASON finished with the result $? ($CI_JOB_URL)." | .builds/irc-send irc.ergo.chat commit-bot mcepl "#m2crypto"
allow_failure: true
leap:
# image: registry.suse.com/bci/bci-base:latest
image: opensuse/leap
when: always
stage: build
artifacts:
paths:
- "src/SWIG/*.c"
script:
- zypper refresh
- zypper install -y pattern:devel_rpm_build pattern:devel_C_C++ osc
- zypper install -y swig python3-devel python3-pip libopenssl-devel openssl python3-service_identity python3-setuptools python3-Twisted
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip --disable-pip-version-check install --user --upgrade-strategy only-if-needed -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mpip --disable-pip-version-check wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- find . -name \*.c -ls
- python3 -mpip --disable-pip-version-check install -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/M2Crypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) python3 -munittest -b -v tests.alltests.suite
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
opensuse:
image: opensuse/tumbleweed
when: always
stage: build
script:
- zypper refresh
- zypper install -y --force-resolution pattern:devel_rpm_build pattern:devel_C_C++ osc
- zypper install -y --force-resolution swig python3-devel python3-pip libopenssl-devel openssl python3-service_identity python3-setuptools python3-Twisted python3-irc
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --user --break-system-packages -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mpip wheel --verbose --no-cache-dir --no-clean --no-build-isolation --wheel-dir dist/ --editable .
- python3 -mpip install -v --upgrade --target $(readlink -f build/lib.*) --no-compile --ignore-installed --no-deps --no-index dist/[mM]2[cC]rypto*.whl
- PYTHONPATH=$(readlink -f build/lib.*) python3 -munittest -b -v tests.alltests.suite
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
- echo "$IRC_PASS" > ~/.irc_pass && chmod 600 ~/.irc_pass
- echo "GitLab build task $CI_JOB_NAME for $REASON finished with the result $? ($CI_JOB_URL)." | .builds/irc-send irc.ergo.chat commit-bot mcepl "#m2crypto"
build-sdist:
image: python:3
when: always
stage: build
artifacts:
paths:
- "dist/*.tar.gz"
script:
- apt-get update -q -y
- apt-get install -y swig libssl-dev python3-dev python3-pip openssl python3-setuptools python3-twisted python3-pip
- mkdir -p $HOME/.local/bin
- ls $HOME/.local/bin
- export PATH=$PATH:$HOME/.local/bin
- python3 -mpip install --break-system-packages --user -r dev-requirements.txt
- ls $HOME/.local/bin
- python3 -mbuild . --sdist
- echo "$PYTHONPATH" ; python3 -c 'import sys; print(sys.path)'
- echo "$IRC_PASS" > ~/.irc_pass && chmod 600 ~/.irc_pass
- echo "GitLab build task $CI_JOB_NAME for $REASON finished with the result $? ($CI_JOB_URL)." | .builds/irc-send irc.ergo.chat commit-bot mcepl "#m2crypto"
release-pypi:
stage: deploy
image: python:latest
dependencies:
- build-test-windows
- build-sdist
id_tokens:
PYPI_ID_TOKEN:
aud: pypi
script:
- echo "Built artifacts:"
- ls dist/
# Install dependencies
- apt update && apt install -y jq
- python -m pip install -U twine id
# Retrieve the OIDC token from GitLab CI/CD, and exchange it for a PyPI API token
- oidc_token=$(python -m id PYPI)
- resp=$(curl -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\":\"${oidc_token}\"}")
- api_token=$(jq --raw-output '.token' <<< "${resp}")
# Upload wheel to PyPI authenticating via the newly-minted token
- twine upload -u __token__ -p "${api_token}" dist/*
rules:
- if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/ # Job enabled only when pushing tags for versions, e.g: 0.40.1
when: manual # Can only be triggered manually
|