File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -174,12 +174,13 @@ This action relies on git tags to be present in order to generate an artifact ta
1741743) This action requires to [poetry](https://python-poetry.org/docs/master/) ~1.2 being installed in build environment (for example, by [install_poetry action](#install_poetry))
175175
176176# ## Inputs
177- | Name | Description | Optional | Default value |
178- |---------------------|:----------------------------------------------------------------------------|----------|---------------|
179- | pypi_repo_url | Package index URL | False | |
180- | pypi_token_username | Package index authentication username | False | |
181- | pypi_token | Package index authentication token or password. | False | |
182- | package_name | Name of package to create. This should match name of root project directory | False | |
177+ | Name | Description | Optional | Default value |
178+ |---------------------|:-------------------------------------------------------------------------------------|----------|:---------------|
179+ | pypi_repo_url | Package index URL | False | |
180+ | pypi_token_username | Package index authentication username | False | |
181+ | pypi_token | Package index authentication token or password. | False | |
182+ | package_name | Name of package to create. This should match name of root project directory | False | |
183+ | version | Version of package. If not provided, a new **development** version will be generated | | Empty |
183184
184185# ## Outputs
185186No outputs defined
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ inputs:
2222 description : Name of package to create. This should match name of root project directory
2323 required : true
2424
25+ version :
26+ description : Version of package (if not provided, a new development version will be generated)
27+ required : false
28+ default : ' '
29+
2530outputs :
2631 version :
2732 description : " Version"
4045 POETRY_HTTP_BASIC_CUSTOM_REPO_USERNAME : ${{ inputs.pypi_token_username }}
4146 POETRY_HTTP_BASIC_CUSTOM_REPO_PASSWORD : ${{ inputs.pypi_token }}
4247 PACKAGE_NAME : ${{ inputs.package_name }}
48+ VERSION : ${{ inputs.version }}
4349 id : package-generator
4450 - name : Create comment
4551 uses : peter-evans/create-or-update-comment@v2
52+ if : github.event.issue.number
4653 with :
4754 issue-number : ${{ github.event.issue.number }}
4855 body : Created package with number `${{ steps.package-generator.outputs.version }}`
Original file line number Diff line number Diff line change 1616
1717set -Eeuo pipefail
1818
19- next_version=$( git describe --tags --abbrev=0 | awk -F. ' /[0-9]+\./{$NF++;print}' OFS=.)
20- version=${next_version} a${PULL_REQUEST_NUMBER} .dev${COMMENTS_COUNT}
19+ if [[ -z " $VERSION " ]]; then
20+ next_version=$( git describe --tags --abbrev=0 | awk -F. ' /[0-9]+\./{$NF++;print}' OFS=.)
21+ version=${next_version} a${PULL_REQUEST_NUMBER} .dev${COMMENTS_COUNT}
22+ else
23+ version=" $VERSION "
24+ fi ;
2125sed -i " s/version = \" 0.0.0\" /version = \" $version \" /" pyproject.toml
2226echo " __version__ = '$version '" > " ./$PACKAGE_NAME /_version.py"
2327echo " REPOSITORY TO PUBLISH IS $REPO_URL "
You can’t perform that action at this time.
0 commit comments