chore: prepare v0.1.3 release\n\n- docs: update README, wiki content,… #4
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: Publish to PyPI | ||
|
Check failure on line 1 in .github/workflows/publish.yml
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| jobs: | ||
| test-build-publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
| pip install pytest build | ||
| - name: Run tests (headless) | ||
| env: | ||
| MPLBACKEND: Agg | ||
| run: pytest -q | ||
| - name: Verify tag matches version | ||
| run: | | ||
| VERSION=$(python -c "import re;print(re.search(r"""__version__\s*=\s*'([^']+)'""", open('statclean/__init__.py').read()).group(1))") | ||
| TAG=${GITHUB_REF_NAME#v} | ||
| echo "Version: $VERSION | Tag: $TAG" | ||
| if [ "$VERSION" != "$TAG" ]; then echo "Tag ($TAG) does not match version ($VERSION)" && exit 1; fi | ||
| - name: Build package | ||
| run: python -m build | ||
| - name: Publish to PyPI (Trusted Publisher) | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| skip-existing: true | ||
| name: Publish to PyPI and GitHub Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.x' | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build | ||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| name: Release ${{ github.ref_name }} | ||
| body: | | ||
| StatClean ${{ github.ref_name }} - A comprehensive statistical data preprocessing and outlier detection library. | ||
| See [CHANGELOG.md](https://github.com/SubaashNair/StatClean/blob/main/CHANGELOG.md) for detailed release notes. | ||
| ## Installation | ||
| ``` | ||
| pip install statclean==${{ github.ref_name }} | ||
| ``` | ||
| - name: Build package | ||
| run: python -m build | ||
| - name: Publish package distributions to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||