Skip to content
Merged
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
58 changes: 58 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: pypi-release

on:
push:
tags:
- 'v*.*.*'
pull_request:
branches:
- main
types:
- labeled
- opened
- edited
- synchronize
- reopened

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Cache dependencies
id: pip-cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip

- name: Install dependencies
run: |
pip install --upgrade pip
pip install wheel
pip install "packaging>=24.2"

- name: Checkout code
uses: actions/checkout@v3

- name: Build and publish to Test PyPI
if: ${{ (github.ref != 'refs/heads/main') && (github.event.label.name == 'release') }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: |
make dist
ls dist/
tar tvf dist/cebra_lens-*.tar.gz
python3 -m twine upload --repository testpypi dist/*

- name: Build and publish to PyPI
if: ${{ github.event_name == 'push' }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
make dist
ls dist/
tar tvf dist/cebra_lens-*.tar.gz
python3 -m twine upload dist/*
Loading