name: Publish 📦 to DockerHub

on:
  push:
    tags:
      - "v*"

env:
  alpine_version: alpine3.12
  debian_version: buster

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 5
      matrix:
        os: [alpine, debian]

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python 3.8
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: Skip if this is not a final release
        shell: python
        run: |
          import sys
          import pkg_resources
          version_file = open("version", "r")
          version = version_file.readline().strip()
          parsed_version = pkg_resources.parse_version(version)
          if parsed_version.pre or parsed_version.dev:
              print("This is a pre- or dev- release - skipping push.")
              sys.exit(1)
      - name: Publish to DockerHub
        env:
          os: ${{ matrix.os }}
        with:
          docker_username: ${{ secrets.DOCKER_USERNAME }}
          docker_password: ${{ secrets.DOCKER_PASSWORD }}
        run: |
          ./dev/build_docker_images.sh

name: Publish 📦 to DockerHub

on:
  push:
    tags:
      - "v*"

env:
  alpine_version: alpine3.12
  debian_version: buster

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 5
      matrix:
        os: [alpine, debian]

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python 3.8
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: Skip if this is not a final release
        shell: python
        run: |
          import sys
          from packaging.version import parse
          version_file = open("version", "r")
          version = version_file.readline().strip()
          parsed_version = parse(version)
          if parsed_version.is_prerelease:
              print("This is a pre- and/or dev- release - skipping push.")
              sys.exit(1)
      - name: Publish to DockerHub
        env:
          os: ${{ matrix.os }}
        with:
          docker_username: ${{ secrets.DOCKER_USERNAME }}
          docker_password: ${{ secrets.DOCKER_PASSWORD }}
        run: |
          ./dev/build_docker_images.sh

Switch to packaging module, as used by pip
Switch to packaging module, as used by pip
