diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..3359f907 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +jobs: + # The Safety Check + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + - run: uv python install 3.10 + - run: uv sync --all-extras --dev + - run: uv run pytest -x + + # The Publisher + # This ONLY runs if 'test' passes successfully. + publish: + needs: test # <--- The Dependency You Requested + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write # IMPORTANT: Required for Trusted Publishing + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Build package + run: uv build + + - name: Publish to PyPI + # We use the official PyPA action for OIDC security + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 90481daf..90f525dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "metadata-scrubber-tool" +name = "metadata-scrubber" version = "0.1.0" description = "A privacy-focused CLI tool that removes sensitive metadata from image files" readme = "README.md"