diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 7a21264..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: "Publish to PyPI" -on: - release -jobs: - make_sdist: - name: Make SDist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Optional, use if you use setuptools_scm - submodules: true # Optional, use if you have submodules - - - name: Build SDist - run: pipx run build --sdist - - - uses: actions/upload-artifact@v4 - with: - name: cibw-sdist - path: dist/*.tar.gz - - upload_all: - needs: [build_wheels, make_sdist] - environment: pypi - permissions: - id-token: write - runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' - steps: - - uses: actions/download-artifact@v4 - with: - pattern: cibw-* - path: dist - merge-multiple: true - - - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 68bdece..9a32675 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -38,6 +38,23 @@ jobs: name: cibw-wheels-${{ matrix.platform }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl + make_sdist: + name: Make SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Optional, use if you use setuptools_scm + submodules: true # Optional, use if you have submodules + + - name: Build SDist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + test: runs-on: ubuntu-latest strategy: @@ -71,3 +88,34 @@ jobs: pytest --cov src/ tests/ - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 + + release: + needs: build_wheels + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - name: Upload Release Asset + uses: softprops/action-gh-release@v2.0.8 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: | + ./wheelhouse/*.whl + dist/*.tar.gz + + + # upload_all: + # needs: [build_wheels, make_sdist] + # environment: pypi + # permissions: + # id-token: write + # runs-on: ubuntu-latest + # if: github.event_name == 'release' && github.event.action == 'published' + # steps: + # - uses: actions/download-artifact@v4 + # with: + # pattern: cibw-* + # path: dist + # merge-multiple: true + + # - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 56ba125..decfcdd 100644 --- a/.gitignore +++ b/.gitignore @@ -169,4 +169,5 @@ CAJAL/data # Data generated by tests tests/*.csv -ocaml \ No newline at end of file +ocaml +.vscode/settings.json