From 1b69b02c1b0a6dfc5bca4e59ba70a499480090a9 Mon Sep 17 00:00:00 2001 From: Spencer Chang Date: Sat, 25 Feb 2023 14:40:24 -0800 Subject: [PATCH] automatically prepare release --- .github/workflows/regression-tests.yml | 30 ++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 2f9d78c..a229a6e 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -13,10 +13,10 @@ jobs: python-version: [3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python ${{matrix.python-version}} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{matrix.python-version}} @@ -29,3 +29,29 @@ jobs: pip install tox tox-gh-actions - name: Test with tox run: tox + + publish_pypi: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags') + steps: + - uses: actions/checkout@v2 + - name: Set up Python + with: + python-version: '3.10' + uses: actions/setup-python@v4 + - name: Install pdm + run: + pip install pdm + - name: Publish to PyPI + env: + PDM_PUBLISH_USERNAME: __token__ + PDM_PUBLISH_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + pdm publish + - name: Create Release on Github + uses: softprops/action-gh-release@v1 + with: + draft: true + prerelease: false + files: ./dist/* + token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}