Skip to content

chore: bump version to 1.0.2 #6

chore: bump version to 1.0.2

chore: bump version to 1.0.2 #6

Workflow file for this run

name: Publish to PyPI
on:
push:
tags:
- 'v*'
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
# Save the dist folder to pass to the next jobs
- name: Store distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
upload-testpypi:
needs: build-package
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/torchmil # Replace with your package name
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
upload-pypi:
needs: [build-package, upload-testpypi] # Only runs if TestPyPI succeeds
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/torchmil # Replace with your package name
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}