Skip to content

Commit

Permalink
Subdirectory path
Browse files Browse the repository at this point in the history
  • Loading branch information
JRubics committed Jan 11, 2023
1 parent 1747275 commit 59e0c84
Show file tree
Hide file tree
Showing 2 changed files with 22 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 }}
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ inputs:
default: "."
runs:
using: "docker"
image: "docker://jrubics/poetry-publish:develop"
image: "docker://jrubics/poetry-publish:v1.16"
args:
- ${{ inputs.python_version }}
- ${{ inputs.poetry_version }}
Expand Down

0 comments on commit 59e0c84

Please sign in to comment.