Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish to PyPI

on:
release:
types: [published]
workflow_dispatch:

jobs:
tests:
name: Run tests before publish
uses: ./.github/workflows/reusable_test.yml
secrets: inherit

build:
name: Build distribution
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build tools
run: pip install build

- name: Build sdist and wheel
run: python -m build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "PrivacyGuard"
description = "PrivacyGuard platform for Privacy Attacks and Analysis. Perform privacy analyses of ML models using Inference Attacks and Extraction Attacks."
authors = [{name = "Meta Platforms, Inc."}]
license = "MIT"
license = "Apache-2.0"
license-files = ["LICENSE"]
readme = "README.md"
requires-python = ">=3.10"
Expand Down Expand Up @@ -93,9 +93,8 @@ find = {}
[tool.setuptools.package-data]
"*" = ["*.js", "*.css", "*.html"]

#[tool.setuptools_scm]
#write_to = "privacy_guard/version.py"
#local_scheme = "node-and-date"
[tool.setuptools_scm]
local_scheme = "node-and-date"

[tool.usort]
first_party_detection = false
Expand Down
Loading