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
52 changes: 5 additions & 47 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,10 @@
name: Publish to PyPI
name: Release and Deploy

on:
push:
branches: [ main ]
branches: [main]
workflow_dispatch: {}

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Check if version changed
id: version_check
run: |
VERSION=$(grep -E '^version = ' pyproject.toml | cut -d'"' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT

if git diff HEAD^ HEAD -- pyproject.toml | grep -q 'version ='; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Build package
if: steps.version_check.outputs.changed == 'true'
run: uv build

- name: Publish to PyPI
if: steps.version_check.outputs.changed == 'true'
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: uv publish

- name: Create GitHub Release
if: steps.version_check.outputs.changed == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION=${{ steps.version_check.outputs.version }}
gh release create "v$VERSION" \
--title "v$VERSION" \
--generate-notes \
dist/*
release:
uses: TransitApp/actions/.github/workflows/python-release.yml@master
26 changes: 9 additions & 17 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build on pull request

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

jobs:
build-and-test:
runs-on: [ubuntu-latest]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', 'pypy3.10']

steps:
- uses: actions/checkout@v2
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Lint with flake8
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
- run: uv python install ${{ matrix.python-version }}
- run: uv sync --all-extras --dev
- name: Lint
run: |
uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.venv
uv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=.venv
- name: Test with pytest
run: uv run pytest .
- run: uv run pytest .
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "py-gtfs-loader"
version = "0.3.1"
version = "0.3.2"
description = "Load GTFS"
readme = "README.md"
authors = [
Expand Down
Loading