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
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run tests
run: |
pytest tests/ -v

- name: Test package installation
run: |
pip install -e .
python -c "from xflow import CEMLflowPlugin, ReportGenerator; print('Import successful')"

- name: Test basic functionality
run: |
python test_plugin_auto_mpg.py
68 changes: 68 additions & 0 deletions .github/workflows/publish-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publish to PyPI

on:
push:
tags:
- 'v*' # Trigger on version tags like v1.0.0, v1.2.3, etc.

jobs:
publish-prod:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Extract version from tag
id: extract_version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"

- name: Update version in pyproject.toml
run: |
sed -i 's/version = "[^"]*"/version = "${{ steps.extract_version.outputs.version }}"/' pyproject.toml
echo "Updated pyproject.toml version to ${{ steps.extract_version.outputs.version }}"

- name: Build package
run: python -m build

- name: Check package
run: python -m twine check dist/*

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*

- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.extract_version.outputs.version }}
body: |
## Changes in this Release

Please see the [CHANGELOG.md](CHANGELOG.md) for detailed changes.

## Installation

```bash
pip install xflow==${{ steps.extract_version.outputs.version }}
```
draft: false
prerelease: false
36 changes: 36 additions & 0 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish to Test PyPI

on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish (optional, will use pyproject.toml version if not specified)'
required: false
type: string

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build

- name: Build package
run: python -m build

- name: Publish package to Test PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Loading