Fix Thesaurus.com scraping issue #6 #1
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| name: ποΈ Build Package | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.check-version.outputs.version }} | |
| package_name: ${{ steps.check-version.outputs.package_name }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: β‘ Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: π Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: π¦ Build package | |
| run: uv build | |
| - name: β Check tag version match | |
| id: check-version | |
| run: | | |
| VERSION=$(grep -m 1 '^version = ' pyproject.toml | cut -d '"' -f 2) | |
| NAME=$(grep -m 1 '^name = ' pyproject.toml | cut -d '"' -f 2) | |
| TAG=${GITHUB_REF#refs/tags/v} | |
| echo "Found version: $VERSION" | |
| echo "Found package name: $NAME" | |
| echo "Found tag: $TAG" | |
| if [ "$VERSION" != "$TAG" ]; then | |
| echo "::error::Version in pyproject.toml ($VERSION) does not match tag ($TAG)" | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "package_name=$NAME" >> $GITHUB_OUTPUT | |
| - name: π€ Upload Build Artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-pypi: | |
| name: π Publish to PyPI | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: release | |
| url: https://pypi.org/project/${{ needs.build.outputs.package_name }} | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: π₯ Download Artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: π€ Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true | |
| github-release: | |
| name: π Create GitHub Release | |
| needs: [build, publish-pypi] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: π₯ Download Artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: π Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| generate_release_notes: true | |
| name: v${{ needs.build.outputs.version }} | |
| body: | | |
| ## ${{ needs.build.outputs.package_name }} v${{ needs.build.outputs.version }} | |
| Install via PyPI: | |
| ```bash | |
| pip install ${{ needs.build.outputs.package_name }}==${{ needs.build.outputs.version }} | |
| ``` | |
| Or via [uv](https://docs.astral.sh/uv/): | |
| ```bash | |
| uv tool install ${{ needs.build.outputs.package_name }}@${{ needs.build.outputs.version }} | |
| ``` |