Merge branch 'main' of github.com:orthanc-team/python-orthanc-tools i… #244
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
# from https://docs.pypi.org/trusted-publishers/using-a-publisher/ | |
# Specifying a GitHub environment is optional, but strongly encouraged | |
environment: release | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Run python tests | |
run: | | |
pip install setuptools | |
python setup.py egg_info | |
pip install -r requirements.txt | |
python -m unittest discover -s orthanc_tools/hl7Lib/tests | |
python -m unittest tests/test_3_orthancs.py | |
python -m unittest tests/test_old_files_deleter.py | |
python -m unittest tests/test_orthanc_replicator.py | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker (python-orthanc-tools) | |
id: meta-python-orthanc-tools | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: orthancteam/python-orthanc-tools | |
labels: | | |
org.opencontainers.image.title=python-orthanc-tools | |
org.opencontainers.image.vendor=Orthanc Team SRL | |
- name: Build and push python-orthanc-tools Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
tags: ${{ steps.meta-python-orthanc-tools.outputs.tags }} | |
labels: ${{ steps.meta-python-orthanc-tools.outputs.labels }} | |
- name: Install build dependencies | |
run: python -m pip install -U setuptools wheel build | |
- name: Build | |
run: python -m build . | |
- name: Publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true |