Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add publisher workflow #13

Merged
merged 1 commit into from
May 23, 2024
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
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.