Skip to content

Commit

Permalink
Merge pull request #32 from JRubics/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
JRubics authored Jan 11, 2023
2 parents fad4b13 + 59e0c84 commit 9321d94
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,18 @@ An optional space-separated list of debian packages to be installed before build

An optional space-separated list of poetry plugins to be installed before building the package

### `package_directory`

An optional subdirectory path if poetry package doesn't reside in the main workflow directory


## Example usage

The following will build and publish the python package to the PyPI using the last version of python and poetry. Specify the python package version and dependencies in `pyproject.toml` in the root directory of your project.

```yaml
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.15
uses: JRubics/poetry-publish@v1.16
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
```
Expand All @@ -72,7 +76,7 @@ Python and poetry versions can be specified in inputs as well as the build_forma
```yaml
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.15
uses: JRubics/poetry-publish@v1.16
with:
python_version: "3.7.1"
poetry_version: "==1.0.5" # (PIP version specifier syntax)
Expand All @@ -86,7 +90,7 @@ Repository can be changed to TestPyPI or a private wheels repo by specifying rep
```yaml
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.15
uses: JRubics/poetry-publish@v1.16
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
repository_name: "testpypi"
Expand All @@ -97,7 +101,7 @@ Repository authentication can be changed to http-basic authentification by speci
```yaml
- name: Build and publish to private Python package repository
uses: JRubics/poetry-publish@v1.15
uses: JRubics/poetry-publish@v1.16
with:
repository_name: "foo"
repository_url: "https://foo.bar/simple/"
Expand All @@ -109,7 +113,7 @@ Extra debian packages can be installed before building the python package. This
```yaml
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.15
uses: JRubics/poetry-publish@v1.16
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
extra_build_dependency_packages: "capnproto libzmq3-dev"
Expand All @@ -119,12 +123,22 @@ Poetry plugins can be added by specifying plugins input
```yaml
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.15
uses: JRubics/poetry-publish@v1.16
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
plugins: "poetry-dynamic-versioning-plugin"
```
Poetry package can be built from a subdirectory. It should be specified as package_directory
```yaml
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
package_directory: "subdirectory"
```
## Example workflow
The following will build and publish the python package when project is tagged in the `v*.*.*` form.
Expand All @@ -141,7 +155,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.15
uses: JRubics/poetry-publish@v1.16
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
```
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ inputs:
plugins:
description: "An optional space-separated list of poetry plugins to be installed before building the package"
required: false
package_directory:
description: "An optional subdirectory path if poetry package doesn't reside in the main workflow directory"
required: false
default: "."
runs:
using: "docker"
image: "docker://jrubics/poetry-publish:v1.15"
image: "docker://jrubics/poetry-publish:v1.16"
args:
- ${{ inputs.python_version }}
- ${{ inputs.poetry_version }}
Expand All @@ -59,3 +63,4 @@ runs:
- ${{ inputs.repository_password }}
- ${{ inputs.extra_build_dependency_packages }}
- ${{ inputs.plugins }}
- ${{ inputs.package_directory }}
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

cd ${13}

if [ -n "${11}" ]; then
apt-get update
apt-get -y upgrade
Expand Down

0 comments on commit 9321d94

Please sign in to comment.