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

test github actions publish to pypi #25

Merged
merged 1 commit into from
Dec 19, 2023
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
23 changes: 15 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
name: Publish to PyPI
on:
# TODO: configure repo to and uncomment below
# pull_request:
# branches: [main]
# types: [closed]
pull_request:
branches: [main]
types: [closed]
workflow_dispatch:
inputs:
version_no:
description: 'Release Version:'
required: true

env:
POETRY_VERSION: "1.7.1"

jobs:
deploy:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/datagov-harvesting-logic/
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
steps:
- name: checkout
uses: actions/checkout@v3
- name: Update setup.py if manual release
if: github.event_name == 'workflow_dispatch'
run: |
# TODO update for pyproject.toml
sed -i "s/version='[0-9]\{1,2\}.[0-9]\{1,4\}.[0-9]\{1,4\}',/version='${{github.event.inputs.version_no}}',/g" setup.py
sed -i "s/version='[0-9]\{1,2\}.[0-9]\{1,4\}.[0-9]\{1,4\}',/version='${{github.event.inputs.version_no}}',/g" pyproject.toml
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Create packages
run: |
python setup.py sdist
python setup.py bdist_wheel
poetry build --verbose
- name: pypi-publish
uses: pypa/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "datagov-harvesting-logic"
version = "0.0.3"
version = "0.0.3-2"
description = ""
# authors = [
# {name = "Jin Sun", email = "[email protected]"},
Expand Down
Loading