
name: Release

on:
  push:
    tags:
      - v*

jobs:
  release:
    name: Release
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        python-version: [3.7]
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v1
        with:
          python-version: ${{ matrix.python-version }}
      - name: Display Python version
        run: python -c "import sys; print(sys.version)"
      - name: Build sdist & wheel
        run: |
          pip install poetry
          poetry install
          poetry build
          ls -lrth dist/
      - name: Publish package
        uses: pypa/gh-action-pypi-publish@master
        with:
          user: __token__
          password: ${{ secrets.pypi_password }}


name: Release

on:
  push:
    tags:
      - v*

jobs:
  release:
    name: Release
    runs-on: ${{ matrix.os }}
    environment:
      name: PyPI
      url: https://pypi.org/project/wechatpy/
    strategy:
      matrix:
        os: [ubuntu-latest]
        python-version: [3.7]
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v1
        with:
          python-version: ${{ matrix.python-version }}
      - name: Display Python version
        run: python -c "import sys; print(sys.version)"
      - name: Build sdist & wheel
        run: |
          pip install poetry
          poetry install
          poetry build
          ls -lrth dist/
      - name: Publish package
        uses: pypa/gh-action-pypi-publish@master
        with:
          user: __token__
          password: ${{ secrets.pypi_password }}

Use environments for deployment on GitHub Actions
Use environments for deployment on GitHub Actions

https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
