diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml deleted file mode 100644 index 14ca1f8..0000000 --- a/.github/workflows/pypi-publish.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Build and deploy with poetry -on: - release: - types: [published] -jobs: - build_and_publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Build and publish to PyPI - uses: JRubics/poetry-publish@v1.17 - with: - repository_name: "test-pypi" - repository_url: "https://test.pypi.org/legacy/" - pypi_token: ${{ secrets.PYPI_TOKEN }} - ignore_dev_requirements: "yes" \ No newline at end of file diff --git a/.github/workflows/release_and_publish.yml b/.github/workflows/release_and_publish.yml new file mode 100644 index 0000000..6fa6d26 --- /dev/null +++ b/.github/workflows/release_and_publish.yml @@ -0,0 +1,34 @@ +name: Create and publish a release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + create_release: + name: Create Release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: ncipollo/release-action@v1 + with: + name: Release ${{ github.ref }} + makeLatest: true + + publish_to_pypi: + name: Publish to PyPI + needs: create_release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build and publish to PyPI + uses: JRubics/poetry-publish@v1.17 + with: + repository_name: "test-pypi" + repository_url: "https://test.pypi.org/legacy/" + pypi_token: ${{ secrets.PYPI_TOKEN }} + ignore_dev_requirements: "yes" \ No newline at end of file diff --git a/.github/workflows/tag-to-release.yml b/.github/workflows/tag-to-release.yml deleted file mode 100644 index 277a52c..0000000 --- a/.github/workflows/tag-to-release.yml +++ /dev/null @@ -1,28 +0,0 @@ -on: - push: - tags: - - 'v*.*.*' - -name: Create releases on tag push - -permissions: write-all - -jobs: - build: - name: Create release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Create release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - body: | - This is an automated release. - draft: false - prerelease: false \ No newline at end of file