diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b815f5b70c8794d71fce5b0b5b0dbd121bae2c90..2143dadb26662a8e52cb36d443de740a275d80bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,8 +4,9 @@ include: file: templates/pre-commit.yml - project: shore/ci-templates file: templates/python.yml - - project: shore/ci-templates - file: templates/gitlab-release.yml + +variables: + SKIP_PYPI_UPLOAD: !!str true build-wheel: extends: .python3-build @@ -61,3 +62,42 @@ bats: needs: - job: build-executable artifacts: true + +upload: + stage: deploy + image: docker.io/curlimages/curl + tags: [host01.shore.co.il] + only: + - tags + script: + - >- + curl + --header "JOB-TOKEN: $CI_JOB_TOKEN" + --upload-file dist/*.whl + "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}.whl" + - >- + curl + --header "JOB-TOKEN: $CI_JOB_TOKEN" + --upload-file dist/mnpw + "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}" + +release: + stage: deploy + image: registry.gitlab.com/gitlab-org/release-cli:latest + script: + - !!str true + only: + - tags + release: + name: Release $CI_COMMIT_TAG + tag_name: $CI_COMMIT_TAG + ref: $CI_COMMIT_TAG + description: Release $CI_COMMIT_TAG + assets: + links: + - name: wheel + url: |- + "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}.whl" + - name: binary + url: |- + "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}" diff --git a/README.rst b/README.rst index 40ea305ed08ecdd21899fd5e4f5d46991c9e9fd2..1ddb773b196ff7bc3f2a7c7ae8c4c16f5df224a8 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,7 @@ Usage as library Although the CLI is of little use to anybody but me, you may find the Nagios plugin handling useful and would want to use it. The package is not published to PyPI so your best option is getting the `latest wheel package -<https://git.shore.co.il/shore/mnpw/-/jobs/artifacts/master/raw/dist/mnpw-0.1.0-py3-none-any.whl?job=build-wheel>`_ +<https://git.shore.co.il/shore/mnpw/-/jobs/artifacts/master/raw/dist/mnpw-0.1.0-dev-py3-none-any.whl?job=build-wheel>`_ or if you want a specific build, get it from the `CI pipelines <https://git.shore.co.il/shore/mnpw/-/pipelines>`_. diff --git a/mnpw/__init__.py b/mnpw/__init__.py index 9b67b4f87c63e1141410c28d37b8305e98a3d114..f5f1dc7a94884c2f89a72ebbeb7e6dba942b32cf 100644 --- a/mnpw/__init__.py +++ b/mnpw/__init__.py @@ -1,6 +1,6 @@ """My Nagios plugin wrapper.""" # pylint: disable=logging-fstring-interpolation -__version__ = "0.1.0" +__version__ = "0.1.0-dev" import argparse import logging diff --git a/pyproject.toml b/pyproject.toml index 4e121086ecbd23c5da5761005346767c15e8b184..d59747e78f79185449d537612b54fcf9348df9c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mnpw" -version = "0.1.0" +version = "0.1.0-dev" description = "My Nagios plugin wrapper" authors = ["Adar Nimrod <nimrod@shore.co.il>"] license = "MIT"