Skip to content

bump version

bump version #1

Workflow file for this run

# This workflow will build a Python project using sdist bdist_wheel
# and publish to PyPI.
name: Publish
on:
push:
tags:
- 'v*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
ARTIFACT_NAME: torch_ecg_dist
ARTIFACT_DIR: dist
# OS_NAME_VERSION: ubuntu-latest
jobs:
build:
# Don't run on forked repos.
if: github.repository_owner == 'DeepPSP'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip' # caching pip dependencies
- name: List existing Python packages
run: |
python -m pip list
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: List installed Python packages
run: |
python -m pip list
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: $ARTIFACT_NAME
path: dist
pypi-publish:
# publishing is separate from building
needs: build
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: $ARTIFACT_NAME
path: $ARTIFACT_DIR
- name: Publish package to TestPyPI # to test, use https://test.pypi.org/
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
packages-dir: $ARTIFACT_DIR
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TORCH_ECG_TOKEN }}
packages-dir: $ARTIFACT_DIR