diff --git a/.github/actions/build-dist/action.yml b/.github/actions/build-dist/action.yml deleted file mode 100644 index 8210603..0000000 --- a/.github/actions/build-dist/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build incremental -description: Build and upload sdist and wheel - -runs: - using: "composite" - steps: - - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - run: pip install build twine - shell: bash - - - run: python3 -m build - shell: bash - - - run: twine check dist/*.* - shell: bash - - - uses: actions/upload-artifact@v4 - with: - name: dist - path: dist/*.* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9fb0461..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Release - -on: - push: - tags: ["incremental-*"] - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-24.04 - - steps: - - uses: ./.github/actions/build-dist - - pypi-publish: - runs-on: ubuntu-24.04 - if: startsWith(github.ref, 'refs/tags/incremental-') - needs: [build] - - environment: - name: release - url: https://pypi.org/p/incremental - - permissions: - id-token: write - - steps: - - - uses: actions/download-artifact@v4 - with: - name: dist - path: dist/ - - - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f0f90f7..397f63b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,7 +10,7 @@ on: # the conditions for which gh-pages are updated. branches: [ trunk ] tags: - - incremental-* + - "incremental-*" pull_request: branches: [ trunk ] @@ -29,7 +29,22 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: ./.github/actions/build-dist + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - run: pip install build twine + + - run: python3 -m build + + - run: twine check dist/*.* + + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/*.* testing: runs-on: ubuntu-24.04 @@ -160,3 +175,24 @@ jobs: with: name: html-report path: htmlcov + + pypi-publish: + runs-on: ubuntu-24.04 + if: startsWith(github.ref, 'refs/tags/incremental-') + needs: [build, testing] + + environment: + name: release + url: https://pypi.org/p/incremental + + permissions: + id-token: write + + steps: + + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - uses: pypa/gh-action-pypi-publish@release/v1