diff --git a/.github/workflows/flit-release.yml b/.github/workflows/flit-release.yml new file mode 100644 index 0000000..832049c --- /dev/null +++ b/.github/workflows/flit-release.yml @@ -0,0 +1,31 @@ +name: CD + +on: + push: + tags: + - v* + +jobs: + publish: + name: Publish to PyPi + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install flit + run: | + pip install flit>=3.9.0 + - name: Build and publish + run: | + flit publish + env: + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets.PYPI_KEY }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ded68cd..01ab9d8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,7 +63,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Installation (deps and package) run: | @@ -100,23 +100,3 @@ jobs: git config --global user.name "semantic-release (via Github actions)" git config --global user.email "semantic-release@github-actions" semantic-release -vv publish - # publish: - # name: Publish to PyPi - # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout source - # uses: actions/checkout@v3 - # - name: Set up Python 3.9 - # uses: actions/setup-python@v1 - # with: - # python-version: 3.9 - # - name: install flit - # run: | - # pip install flit~=3.0 - # - name: Build and publish - # run: | - # flit publish - # env: - # FLIT_USERNAME: __token__ - # FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}