tsutsu3/linkify-it-py

View on GitHub
.github/workflows/pypi-test.yml

Summary

Maintainability
Test Coverage
name: PYPI-TEST-PUBLISH

on:
  workflow_dispatch:
    inputs:
      TESTPYPI_VESION:
        description: 'TestPyPI Version'
        required: true

jobs:
  publish:
    name: Publish to Test PyPi
    runs-on: ubuntu-latest
    steps:
      - name: Checkout source
        uses: actions/checkout@v4
      - name: Set up Python 3.7
        uses: actions/setup-python@v5
        with:
          python-version: 3.7
      - name: Replace version
        run:
          sed -rie "s/__version__ = \"(.*)\"/__version__ = \"\1.${{ inputs.TESTPYPI_VESION }}\""/g linkify_it/__init__.py
      - name: Build package
        run: |
          pip install build
          python -m build
      - name: Publish package distributions to TestPyPI
        uses: pypa/gh-action-pypi-publish@v1.10.3
        with:
          repository-url: https://test.pypi.org/legacy/
          user: __token__
          password: ${{ secrets.TEST_PYPI_KEY }}