-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from GSA/feature/pypi-publish
test github actions publish to pypi
- Loading branch information
Showing
2 changed files
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]"}, | ||
|
71f3114
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report
71f3114
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report