Skip to content
Snippets Groups Projects
pex-build.template.yml 704 B
Newer Older
# CI Build Template
.build-pexes:
    image: python:3.10
    script:
Daniel Lyons's avatar
Daniel Lyons committed
        - pip install build twine poetry pytest
Daniel Lyons's avatar
Daniel Lyons committed
        - WD=$PWD
        - cd ${PEX_PATH}
Daniel Lyons's avatar
Daniel Lyons committed
        - poetry install --with test
Daniel Lyons's avatar
Daniel Lyons committed
#        - pytest test
Daniel Lyons's avatar
Daniel Lyons committed
        - NAME=$(awk -F' = ' '/^\[tool.poetry\]/ { project = 1; next } /^\[.*\]/ { project = 0 } project && $1 == "name" { gsub(/"/, "", $2); print $2 }' pyproject.toml)
        - VERSION=$(sed -n 's/^__version__ = "\(.*\)\"$/\1/p' */__init__.py)
Daniel Lyons's avatar
Daniel Lyons committed
        - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file dist/${NAME}-${VERSION}-py3-none-any.whl "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/${NAME}/${VERSION}/${NAME}-${VERSION}-py3-none-any.whl"'
Daniel Lyons's avatar
Daniel Lyons committed
        - cd $WD