attzonko/mmpy_bot

View on GitHub
.github/workflows/publish.yml

Summary

Maintainability
Test Coverage
name: Release new version

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Semantic version of the form M.m.p[.devXYZ]'
        required: true

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - name: Set up Python 3.10
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'
      - name: Install requirements
        run: pip install --upgrade setuptools twine wheel
      - name: Create wheel
        run: |
          echo ${{ github.event.inputs.version }} > mmpy_bot/version.txt
          python setup.py bdist_wheel
      - name: Upload wheel
        run: twine upload dist/* -u __token__ -p '${{ secrets.PYPI_API_TOKEN }}' --verbose
      - uses: "marvinpinto/action-automatic-releases@latest"
        with:
          repo_token: "${{ secrets.GITHUB_TOKEN }}"
          prerelease: false
          title: "v${{ github.event.inputs.version }}"
          files: |
            LICENSE
            dist/*.whl