dgk/django-business-logic

View on GitHub
.github/workflows/release.yml

Summary

Maintainability
Test Coverage
name: release

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

jobs:
  main:
    runs-on: ubuntu-latest

    environment:
      name: pypi
      url: https://pypi.org/p/django-business-logic

    permissions:
      id-token: write
      contents: write

    steps:

      - name: Checkout code
        uses: actions/checkout@v2

      - name: Set up Python 3.10
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install wheel

      - name: Build package
        run: |
          python setup.py sdist bdist_wheel

      - name: Publish package distributions to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.PYPI_API_TOKEN }}

      - name: Create Release
        id: create_release
        uses: comnoco/create-release-action@v2.0.5
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref_name }}
          body: |
            Pypi release: https://pypi.org/project/django-business-logic/${{ github.ref_name }}/
          draft: false
          prerelease: false