Skip to content

Commit 27fc6fa

Browse files
author
Tim Joseph
committed
Updated workflows to use pypi
1 parent dcec033 commit 27fc6fa

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

.github/workflows/publish-nightly.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Publish Nightly
22

33
on:
44
push:
5-
branches: ["test-nightly"]
5+
branches: ["main"]
66

77
permissions:
88
contents: read
@@ -24,10 +24,10 @@ jobs:
2424
# Extract the base version from pyproject.toml (e.g., "0.5.0")
2525
BASE_VERSION=$(cat pyproject.toml | grep -oP 'version = "\K[^"]+')
2626
27-
# Create a date-based suffix (e.g., ".dev20250707222204")
27+
# Create a date-based suffix (e.g., ".dev20250719203543")
2828
NIGHTLY_SUFFIX=".dev$(date +'%Y%m%d%H%M%S')"
2929
30-
# Combine them into the full nightly version (e.g., "0.5.0.dev20250707222204")
30+
# Combine them into the full nightly version (e.g., "0.5.0.dev20250719203543")
3131
NIGHTLY_VERSION="$BASE_VERSION$NIGHTLY_SUFFIX"
3232
3333
echo "Setting package version to: $NIGHTLY_VERSION"
@@ -50,19 +50,13 @@ jobs:
5050
needs:
5151
- build
5252
permissions:
53-
# This permission is mandatory for trusted publishing.
53+
# This permission is mandatory for trusted publishing to PyPI.
5454
id-token: write
5555

56-
# Dedicated environments with protections for publishing are strongly recommended.
57-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
56+
# Using a dedicated environment for PyPI is a recommended security practice.
5857
environment:
59-
name: testpypi
60-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
61-
# url: https://pypi.org/p/YOURPROJECT
62-
#
63-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
64-
# ALTERNATIVE: exactly, uncomment the following line instead:
65-
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
58+
name: pypi
59+
url: https://pypi.org/p/tensorcontainer
6660

6761
steps:
6862
- name: Retrieve release distributions
@@ -74,5 +68,4 @@ jobs:
7468
- name: Publish release distributions to PyPI
7569
uses: pypa/gh-action-pypi-publish@release/v1
7670
with:
77-
packages-dir: dist/
78-
repository-url: https://test.pypi.org/legacy/
71+
packages-dir: dist/

.github/workflows/publish-release.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ jobs:
2727
pip install build
2828
2929
- name: Build release distributions
30-
run: |
31-
python -m pip install build
32-
python -m build
30+
run: python -m build
3331

34-
- name: Upload distributions
32+
- name: Upload distributions as an artifact
3533
uses: actions/upload-artifact@v4
3634
with:
3735
name: release-dists
@@ -47,8 +45,8 @@ jobs:
4745

4846
# You must configure this environment in your repository settings.
4947
environment:
50-
name: testpypi
51-
url: https://test.pypi.org/p/tensorcontainer/${{ github.event.release.tag_name }}
48+
name: pypi
49+
url: https://pypi.org/p/tensorcontainer/${{ github.event.release.tag_name }}
5250

5351
steps:
5452
- name: Retrieve release distributions from artifact
@@ -58,7 +56,4 @@ jobs:
5856
path: dist/
5957

6058
- name: Publish package to PyPI
61-
uses: pypa/gh-action-pypi-publish@release/v1
62-
with:
63-
# This line directs the upload to TestPyPI
64-
repository-url: https://test.pypi.org/legacy/
59+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)