Merge pull request #167 from CarterPerez-dev/dependabot/uv/PROJECTS/b⦠#5
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
| # ============================================================================= | |
| # AngelaMos | 2026 | |
| # publish-base64-tool.yml | |
| # ============================================================================= | |
| name: Publish b64tool to PyPI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'PROJECTS/beginner/base64-tool/**' | |
| - '!PROJECTS/beginner/base64-tool/README.md' | |
| - '!PROJECTS/beginner/base64-tool/Justfile' | |
| permissions: | |
| contents: read | |
| jobs: | |
| pypi-publish: | |
| name: Upload b64tool to PyPI | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/b64tool | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Check if version exists on PyPI | |
| id: version_check | |
| working-directory: PROJECTS/beginner/base64-tool | |
| run: | | |
| VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") | |
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/b64tool/${VERSION}/json") | |
| if [ "$STATUS" = "200" ]; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| echo "::notice::b64tool v${VERSION} already on PyPI β skipping publish" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| echo "::notice::b64tool v${VERSION} not on PyPI β publishing" | |
| fi | |
| - name: Install build dependencies | |
| if: steps.version_check.outputs.exists != 'true' | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| - name: Build package | |
| if: steps.version_check.outputs.exists != 'true' | |
| working-directory: PROJECTS/beginner/base64-tool | |
| run: python -m build | |
| - name: Publish to PyPI | |
| if: steps.version_check.outputs.exists != 'true' | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: PROJECTS/beginner/base64-tool/dist/ |