Skip to content

Commit

Permalink
Merge pull request #25 from GSA/feature/pypi-publish
Browse files Browse the repository at this point in the history
test github actions publish to pypi
  • Loading branch information
robert-bryson authored Dec 19, 2023
2 parents e9eccbc + a532439 commit 71f3114
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
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

2 comments on commit 71f3114

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
harvester
   __init__.py100100% 
   compare.py50100% 
   extract.py4877 85%
   load.py8522 98%
   transform.py50100% 
harvester/utils
   __init__.py20100% 
   json.py40100% 
harvester/validate
   __init__.py20100% 
   dcat_us.py2433 88%
TOTAL1851294% 

Tests Skipped Failures Errors Time
24 0 💤 0 ❌ 0 🔥 28.116s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
harvester
   __init__.py100100% 
   compare.py50100% 
   extract.py4877 85%
   load.py8522 98%
   transform.py50100% 
harvester/utils
   __init__.py20100% 
   json.py40100% 
harvester/validate
   __init__.py20100% 
   dcat_us.py2433 88%
TOTAL1851294% 

Tests Skipped Failures Errors Time
24 0 💤 0 ❌ 0 🔥 32.739s ⏱️

Please sign in to comment.