From e1fa06edf8f3157fb7c90bc036ce1a80a31b9eb7 Mon Sep 17 00:00:00 2001 From: Léo Vansimay Date: Fri, 16 Apr 2021 15:37:47 +0200 Subject: Create python-publish.yml Attempt to add a github action to publish a PyPI package on each release.--- .github/workflows/python-publish.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/python-publish.yml (limited to '.github/workflows/python-publish.yml') diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 00000000..088bc13d --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,31 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} #Same as Docker, need to add an account in the secrets + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* -- cgit v1.3.1 From f5d2eebfe806761f74ac5ac00b8bc74c12ce1de3 Mon Sep 17 00:00:00 2001 From: Léo Vansimay Date: Mon, 19 Apr 2021 14:20:32 +0200 Subject: Update python-publish.yml calls the publisher on each push--- .github/workflows/python-publish.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to '.github/workflows/python-publish.yml') diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 088bc13d..0f442307 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,9 +3,7 @@ name: Upload Python Package -on: - release: - types: [created] +on: [push] jobs: deploy: -- cgit v1.3.1 From 1b637cbb3b287e5607e78a2be4153eee6b8aa846 Mon Sep 17 00:00:00 2001 From: Léo Vansimay Date: Wed, 21 Apr 2021 11:13:20 +0200 Subject: Update python-publish.yml The build seems to work well, modify the rules to publish the package when a push or PR on master occurs--- .github/workflows/python-publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '.github/workflows/python-publish.yml') diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0f442307..fb2b2323 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,7 +3,11 @@ name: Upload Python Package -on: [push] +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] jobs: deploy: -- cgit v1.3.1 From 8d3b03c02fa550d6c73e5993797ffce4efc66afa Mon Sep 17 00:00:00 2001 From: Léo Vansimay Date: Fri, 23 Apr 2021 11:11:36 +0200 Subject: Update python-publish.yml Forcing 3.8 for compatibility purpose--- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows/python-publish.yml') diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index fb2b2323..22f85fe2 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: '3.x' + python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip -- cgit v1.3.1 From cb02c5a6b48cd9b71a0f5a23925bcb8f6b036d66 Mon Sep 17 00:00:00 2001 From: Adam Janovsky Date: Sat, 24 Apr 2021 12:44:51 +0200 Subject: add badges, workflow dispatch on publish --- .github/workflows/python-publish.yml | 40 ++++++++++++++++++------------------ README.md | 24 +++++++++++++++------- 2 files changed, 37 insertions(+), 27 deletions(-) (limited to '.github/workflows/python-publish.yml') diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 22f85fe2..2fab292d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,31 +3,31 @@ name: Upload Python Package -on: +on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] + workflow_dispatch: jobs: deploy: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} #Same as Docker, need to add an account in the secrets - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} #Same as Docker, need to add an account in the secrets + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/README.md b/README.md index 144d7bb6..340f1329 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,29 @@ Tool for analysis of security certificates and their security targets (Common Cr This project is developed by the [Centre for Research On Cryptography and Security](https://crocs.fi.muni.cz) at Faculty of Informatics, Masaryk University. -![Website](https://img.shields.io/website?down_color=red&down_message=offline&style=flat-square&up_color=SpringGreen&up_message=online&url=https%3A%2F%2Fseccerts.org) +[![Website](https://img.shields.io/website?down_color=red&down_message=offline&style=flat-square&up_color=SpringGreen&up_message=online&url=https%3A%2F%2Fseccerts.org)](https://seccerts.org) +[![PyPI](https://img.shields.io/pypi/v/sec-certs?style=flat-square)](https://pypi.org/project/sec-certs/) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sec-certs?label=Python%20versions&style=flat-square)](https://pypi.org/project/sec-certs/) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/crocs-muni/sec-certs/tests?style=flat-square)](https://github.com/crocs-muni/sec-certs/actions/workflows/GA_CI.yml) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/crocs-muni/sec-certs/Docker%20Image%20CI?label=Docker%20build&style=flat-square)](https://hub.docker.com/repository/docker/seccerts/sec-certs) -![PyPI](https://img.shields.io/pypi/v/sec-certs?style=flat-square) +## Installation (CC) -![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sec-certs?label=Python%20versions&style=flat-square) +The tool requires several Python packages as well as the `pdftotext` binary somewhere on the `PATH`. +[ +The stable release is published on [PyPi](https://pypi.org/project/sec-certs/) as well as on [DockerHub](https://hub.docker.com/repository/docker/seccerts/sec-certs), you can install it with: -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/crocs-muni/sec-certs/tests?style=flat-square) +``` +pip install -U sec-certs +``` +or -## Installation (CC) +``` +docker pull seccerts/sec-certs +``` -The tool requires several Python packages as well as the `pdftotext` binary somewhere on the `PATH`. -The easiest way to setup the tool is to install it in a virtual environment, e.g.: +Alternatively, you can setup the tool for development in a virtual environment, e.g.: Install Python virtual environment (if not yet): ``` python3 -m pip install --upgrade pip -- cgit v1.3.1 From 0605835a24e49840a7b475116ecd6f0390212695 Mon Sep 17 00:00:00 2001 From: Léo Vansimay Date: Thu, 29 Apr 2021 11:10:49 +0200 Subject: Update python-publish.yml The method currently used only works when we tag a version number, I'm trying to use testpypi to avoid a failed build on each try. Moreover the build and push to PyPI will only trigger on a push with a tag--- .github/workflows/python-publish.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to '.github/workflows/python-publish.yml') diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2fab292d..782ec7aa 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -24,10 +24,20 @@ jobs: run: | python -m pip install --upgrade pip pip install setuptools wheel twine - - name: Build and publish + + - name: Build and publish to PyPI + if: startsWith(github.ref, 'refs/tags') env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} #Same as Docker, need to add an account in the secrets TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | python setup.py sdist bdist_wheel twine upload dist/* + + - name: Build and publish to PyPI + env: + TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} #Same as Docker, need to add an account in the secrets + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload --repository testpypi dist/* -- cgit v1.3.1