From aa2ffedda9d05e74952d4066ea8b0b51885a7e85 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Wed, 16 Jul 2025 13:32:28 -0700 Subject: [PATCH 01/12] Add PyPI release workflow --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..367ea77f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: PyPI Release + +# on: +# push: +# tags: +# - 'v*' # Only publish on version tags +on: + pull_request: + branches: [ "main" ] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -e '.[dev]' + + - name: Save version and commit hash + # Equivalent to `VERSION="$(git describe --tags --abbrev=0 | sed 's/^v//')"` + run: | + VERSION="${GITHUB_REF#refs/tags/v}" + COMMIT="$(git rev-parse --short HEAD)" + echo "__version__ = \"${VERSION}\"" > debug_gym/version.py + echo "__commit__ = \"${COMMIT}\"" >> debug_gym/version.py + echo "__version__ = \"${VERSION}\"" + echo "__commit__ = \"${COMMIT}\"" + + - name: Build package + run: python -m build + + # - name: Publish to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 846e9b8e..59c6348e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' From 812c0ecb187d57270465549818567db22c07fc39 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Wed, 16 Jul 2025 13:34:31 -0700 Subject: [PATCH 02/12] Add commit hash to version.py --- debug_gym/version.py | 1 + 1 file changed, 1 insertion(+) diff --git a/debug_gym/version.py b/debug_gym/version.py index 5becc17c..3b41fe4b 100644 --- a/debug_gym/version.py +++ b/debug_gym/version.py @@ -1 +1,2 @@ __version__ = "1.0.0" +__commit__ = "f328f9e9bcbb7b4610592fa1c27d155049f086f7" From dc069a021ed0dad36cda69f7cba25c73aae32c93 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Wed, 16 Jul 2025 13:42:52 -0700 Subject: [PATCH 03/12] pip install build --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 367ea77f..ffcb79f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,7 @@ jobs: - name: Install dependencies run: | pip install --upgrade pip + pip install build pip install -e '.[dev]' - name: Save version and commit hash From afd1a3cd206d01921c54766dce44631b6d550ca7 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Wed, 16 Jul 2025 13:54:12 -0700 Subject: [PATCH 04/12] Use git to extract version --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffcb79f1..b1b69c69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,9 +27,8 @@ jobs: pip install -e '.[dev]' - name: Save version and commit hash - # Equivalent to `VERSION="$(git describe --tags --abbrev=0 | sed 's/^v//')"` run: | - VERSION="${GITHUB_REF#refs/tags/v}" + VERSION="$(git describe --tags --abbrev=0 | sed 's/^v//')" COMMIT="$(git rev-parse --short HEAD)" echo "__version__ = \"${VERSION}\"" > debug_gym/version.py echo "__commit__ = \"${COMMIT}\"" >> debug_gym/version.py From 4b4a554cb16113564825ff27f7d22209d0bad296 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Thu, 17 Jul 2025 10:04:38 -0700 Subject: [PATCH 05/12] Fetch all tags in the checkout step of the release workflow --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1b69c69..280ce0e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all tags - name: Set up Python uses: actions/setup-python@v5 From 5155566cf7f171ed8c2bc0a5dec835c11b8c45e7 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Thu, 17 Jul 2025 10:11:13 -0700 Subject: [PATCH 06/12] Update checkout step to fetch only tags, not full history --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 280ce0e4..dfdad29c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 # Fetch all tags + fetch-tags: true # Fetch all tags so we can get the latest version - name: Set up Python uses: actions/setup-python@v5 From cc3c32933de3e1821423a7922996c23aa1c98332 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Thu, 17 Jul 2025 10:16:49 -0700 Subject: [PATCH 07/12] Revert to `fetch-depth: 0` --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfdad29c..91341a10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-tags: true # Fetch all tags so we can get the latest version + fetch-depth: 0 # Fetch all tags so we can get the latest version - name: Set up Python uses: actions/setup-python@v5 From a18d432cd467a211de94321ac5c4a50c69362f8c Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Thu, 17 Jul 2025 10:48:35 -0700 Subject: [PATCH 08/12] Uncomment the Publish to PyPI step in the release workflow --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91341a10..975cf287 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,5 +40,5 @@ jobs: - name: Build package run: python -m build - # - name: Publish to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From 3b376dcd8e9a26137c63f47ea1ae061ab19a2c97 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Thu, 17 Jul 2025 10:49:13 -0700 Subject: [PATCH 09/12] Update release workflow to trigger on all tags instead of prs --- .github/workflows/release.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 975cf287..3ea08884 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,9 @@ name: PyPI Release -# on: -# push: -# tags: -# - 'v*' # Only publish on version tags on: - pull_request: - branches: [ "main" ] + push: + tags: + - '*' jobs: build-and-publish: From ce1c22e991e70b5b1152952d47b23abe12cd9b67 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Thu, 17 Jul 2025 10:50:07 -0700 Subject: [PATCH 10/12] Drop dynamic versioning for now --- .github/workflows/release.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ea08884..1c0d3c42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,8 +11,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all tags so we can get the latest version - name: Set up Python uses: actions/setup-python@v5 @@ -25,15 +23,6 @@ jobs: pip install build pip install -e '.[dev]' - - name: Save version and commit hash - run: | - VERSION="$(git describe --tags --abbrev=0 | sed 's/^v//')" - COMMIT="$(git rev-parse --short HEAD)" - echo "__version__ = \"${VERSION}\"" > debug_gym/version.py - echo "__commit__ = \"${COMMIT}\"" >> debug_gym/version.py - echo "__version__ = \"${VERSION}\"" - echo "__commit__ = \"${COMMIT}\"" - - name: Build package run: python -m build From 80aacf162f32f2c998de4f5dedc9c3412fdd0d5a Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Thu, 17 Jul 2025 10:56:55 -0700 Subject: [PATCH 11/12] Revert changes to version --- debug_gym/version.py | 1 - 1 file changed, 1 deletion(-) diff --git a/debug_gym/version.py b/debug_gym/version.py index 3b41fe4b..5becc17c 100644 --- a/debug_gym/version.py +++ b/debug_gym/version.py @@ -1,2 +1 @@ __version__ = "1.0.0" -__commit__ = "f328f9e9bcbb7b4610592fa1c27d155049f086f7" From e9104099ac4259642547d8ec25093160ef36b304 Mon Sep 17 00:00:00 2001 From: Matheus Pereira Date: Thu, 17 Jul 2025 11:30:27 -0700 Subject: [PATCH 12/12] Add project urls --- pyproject.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c76b328d..e8099b4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,13 +8,18 @@ description = "debug-gym - interactive debugging environment" readme = "README.md" requires-python = ">=3.12" dynamic = ["dependencies", "version"] - classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] +[project.urls] +Homepage = "https://aka.ms/debug-gym" +Repository = "https://github.com/microsoft/debug-gym" +Issues = "https://github.com/microsoft/debug-gym/issues" +Changelog = "https://github.com/microsoft/debug-gym/blob/main/CHANGELOG.md" + [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} version = {attr = "debug_gym.__version__"}