From 4899e0164201c7fb4d2d31746134462be068d386 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 8 Aug 2022 10:59:40 +0200 Subject: [PATCH] Prepare v0.3.0.rc1 --- .github/workflows/main.yml | 4 +-- .github/workflows/pypi.yml | 57 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e38ecf..78f9c32 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,9 +3,9 @@ name: CI on: push: - branches: [ "master", "v*" ] + branches: [ "main", "v*" ] pull_request: - branches: [ "master", "v*" ] + branches: [ "main", "v*" ] workflow_dispatch: permissions: diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..6c36fa1 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,57 @@ +--- +name: Build and upload to PyPI + +permissions: + contents: read + +on: + workflow_dispatch: + inputs: + tag: + description: tag to build + required: true + type: string + testpypi: + description: upload to Test PyPI + type: boolean + default: false + pypi: + description: upload to PyPI + type: boolean + default: false + +jobs: + tests: + uses: /.github/workflows/main.yml + pypi: + name: Build and upload to PyPI + runs-on: ubuntu-latest + needs: tests + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ inputs.tag || github.ref }} + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: "Update pip" + run: python -m pip install --upgrade pip setuptools wheel + - name: "Install 'build' and 'twine'" + run: python -m pip install --upgrade build twine + - name: "Run 'build'" + run: "python -m build" + - name: "Run twine check" + run: "python -m twine check dist/*" + - name: Publish distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + if: inputs.testpypi || false + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} + if: inputs.pypi || false