hiroaki-yamamoto/django-good-otp

View on GitHub
.github/workflows/deploy.yml

Summary

Maintainability
Test Coverage
name: Deploy

on:
  push:
    tags:
      - '[0-9]+\.[0-9]+\.[0-9]+'

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: deploy

    steps:
      - uses: actions/checkout@v4
        with:
          python-version: "^3.0"
          architecture: "x64"
      - name: Set up Python
        uses: actions/setup-python@v5
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install flake8 pytest twine
          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
      - name: Write the version info
        run: echo -n '${{ github.ref_name }}' > VERSION
      - name: Create the package
        run: python setup.py sdist
      - name: Deploy
        run: twine upload dist/*
        env:
          TWINE_USERNAME: __token__
          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}