From c23277035596d890a47ad18569f8215decbac2cf Mon Sep 17 00:00:00 2001 From: s3lph Date: Tue, 25 Jul 2023 03:29:51 +0200 Subject: [PATCH] feat: use forgejo package repo instead of minio --- .woodpecker.yml | 48 ++++++++++++++++++++---------------------------- setup.py | 3 ++- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index bf75d4d..4f15823 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -21,14 +21,22 @@ pipeline: build_wheel: image: python:3.11-bookworm group: package + when: + event: tag commands: - - export EXPORTER_VERSION=$(python3 -c 'import tlsrpt_exporter; print(tlsrpt_exporter.__version__)') + - pip3 install -e .[test] - python3 setup.py egg_info bdist_wheel - - mkdir -p "publish/prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}" - - mv dist/*whl "publish/prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}" - - cd "publish/prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}" - - sha256sum *.whl >> SHA256SUMS - - cp *.whl ../prometheus-tlsrpt-exporter.whl + - | + cat > ~/.pypirc < package/debian/prometheus-tlsrpt-exporter/usr/share/doc/prometheus-tlsrpt-exporter/changelog - | @@ -61,25 +69,9 @@ pipeline: - chmod +x prometheus-tlsrpt-exporter/usr/bin/prometheus-tlsrpt-exporter prometheus-tlsrpt-exporter/DEBIAN/postinst prometheus-tlsrpt-exporter/DEBIAN/prerm - sed -re "s/__VERSION__/$${EXPORTER_VERSION}-1/g" -i prometheus-tlsrpt-exporter/DEBIAN/control - dpkg-deb --build prometheus-tlsrpt-exporter - - cd ../.. - - mkdir -p "publish/prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}" - - mv package/debian/prometheus-tlsrpt-exporter.deb "publish/prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}/prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}-1_all.deb" - - cd "publish/prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}" - sudo -u nobody lintian "prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}-1_all.deb" || true - - sha256sum "prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}-1_all.deb" >> SHA256SUMS - - cp "prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}-1_all.deb" ../prometheus-tlsrpt-exporter.deb - - upload: - image: woodpeckerci/plugin-s3 - group: upload - settings: - endpoint: https://minio.kabelsalat.ch - bucket: s3lph-prometheus-tlsrpt-exporter - access_key: - from_secret: S3_ACCESS_KEY_ID - secret_key: - from_secret: S3_SECRET_ACCESS_KEY - source: publish/**/* - target: /artifacts - path_style: true - strip_prefix: true + - >- + curl + -XPUT + --data-binary "@prometheus-tlsrpt-exporter_$${EXPORTER_VERSION}-1_all.deb" + $${GITEA_API_REPOSITORY_DEB} diff --git a/setup.py b/setup.py index eea3355..e4c598b 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,8 @@ Prometheus metrics as well as on a web interface. extras_require={ 'test': [ 'coverage', - 'pycodestyle' + 'pycodestyle', + 'twine' ] }, test_loader='unittest:TestLoader',