Skip to content

Commit

Permalink
ci: Add publisher workflow (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
kajanan1212 authored May 23, 2024
1 parent 1fac3d6 commit 525f16a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build Wheel on PR
name: Build Wheel & Publish to PyPI on PR

on:
pull_request:
types: [opened, synchronize, edited, reopened]
types: [opened, synchronize, edited]

jobs:
build:
Expand All @@ -29,6 +29,16 @@ jobs:
mkdir -p wheel_files
cp dist/*.whl wheel_files/
- name: Install twine
run: python -m pip install --upgrade twine

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
Expand All @@ -45,6 +55,14 @@ jobs:
git commit -m "Add new wheel file"
git push "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" HEAD:${{ github.head_ref }}
- name: Create and push tag
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
VERSION_TAG=$(echo ${GITHUB_HEAD_REF} | sed -n 's/^rel-\(.*\)$/v\1/p')
git tag $VERSION_TAG
git push "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" $VERSION_TAG
- name: Rename wheel file
run: |
PR_NUMBER=${{ github.event.number }}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
setup(
name="gps2gtfs",
packages=find_packages(),
version="0.1.1-rc1",
version="main",
description="A Python package to process raw GPS data of public transit and transform to GTFS format.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
Binary file removed wheel_files/gps2gtfs-0.1.0-py3-none-any.whl
Binary file not shown.
Binary file removed wheel_files/gps2gtfs-0.1.1rc1-py3-none-any.whl
Binary file not shown.

0 comments on commit 525f16a

Please sign in to comment.