Merge pull request #70 from USTC-KnowledgeComputingLab/dev/add-suppor… #476
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build wheels | |
| on: | |
| - push | |
| - pull_request | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch all tags | |
| run: git fetch --tags --force | |
| # See: https://github.com/actions/checkout/issues/290 | |
| - name: Build dist | |
| run: pipx run build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-sdist | |
| path: dist/*.tar.gz | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-wheel | |
| path: dist/*.whl | |
| upload: | |
| name: Upload wheels to pypi | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/grassmann_tensor/ | |
| permissions: | |
| id-token: write | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: build-* | |
| path: dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 |