Skip to content
Merged
Show file tree
Hide file tree
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
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build & Publish

on:
push:
tags: [ "v*" ] # build and publish only on version tags
workflow_dispatch:

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: read
id-token: write

env:
PYTHON_VERSION: "3.12" # single source of truth

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false

- uses: astral-sh/setup-uv@v5
- run: uv python install ${{ env.PYTHON_VERSION }}
- run: uv build

- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish:
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/reachml
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
28 changes: 5 additions & 23 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Python package

on:
push:
branches: [ "main", "iclr2025"]
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand All @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -32,30 +32,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Prepare lock
run: uv lock --python ${{ matrix.python-version }}

- name: Install the project
run: uv sync --locked

- name: Run tests
# For example, using `pytest`
run: uv run pytest tests

# - name: Cache poetry install
# uses: actions/cache@v2
# with:
# path: ~/.local
# key: poetry
# - uses: snok/install-poetry@v1
# with:
# version: 1.7.1
# virtualenvs-create: true
# virtualenvs-in-project: true
# - name: Cache deps
# id: cache-deps
# uses: actions/cache@v2
# with:
# path: .venv
# key: pydeps-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}
# - run: poetry install --no-interaction --with dev -E cplex
# name: Install package
# - run: poetry run pytest
# name: Run tests
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ skltemplate/
examples/paper/results

# jekyll
*.yml
.nojekyll

# Notes
Expand Down Expand Up @@ -92,6 +91,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
_version.py

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
Loading