Skip to content

Commit ec93221

Browse files
committed
fix version replacement
1 parent 34b27e5 commit ec93221

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

action.yaml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
name: 'PyPI Poetry Publish'
2-
description: 'Opinionated GitHub action to fully automate publishing packages to any PyPI registry - using Poetry and GitHub releases'
1+
name: "PyPI Poetry Publish"
2+
description: "Opinionated GitHub action to fully automate publishing packages to any PyPI registry - using Poetry and GitHub releases"
33
branding:
4-
icon: 'package'
5-
color: 'blue'
4+
icon: "package"
5+
color: "blue"
66

77
inputs:
88
ACCESS_TOKEN:
9-
description: 'Access Token for GitHub with write access on the repository'
9+
description: "Access Token for GitHub with write access on the repository"
1010
required: true
1111
PYTHON_VERSION:
12-
description: 'Python Version'
12+
description: "Python Version"
1313
required: false
14-
default: '3.10'
14+
default: "3.10"
1515
PACKAGE_DIRECTORY:
16-
description: 'Directory of the package'
16+
description: "Directory of the package"
1717
required: false
18-
default: './'
18+
default: "./"
1919
PUBLISH_REGISTRY_PASSWORD:
20-
description: 'Password for the user to publish to PyPI. May also be a Token - requires the `PUBLISH_REGISTRY_USERNAME` to be `__token__`'
20+
description: "Password for the user to publish to PyPI. May also be a Token - requires the `PUBLISH_REGISTRY_USERNAME` to be `__token__`"
2121
required: true
2222
PUBLISH_REGISTRY_USERNAME:
23-
description: 'The username for the registry. Defaults to __token__'
23+
description: "The username for the registry. Defaults to __token__"
2424
required: false
25-
default: '__token__'
25+
default: "__token__"
2626
POETRY_VERSION:
27-
description: 'The version of Poetry to use'
27+
description: "The version of Poetry to use"
2828
required: false
29-
default: ''
29+
default: ""
3030
POETRY_CORE_VERSION:
31-
description: 'The version of Poetry Core to use'
31+
description: "The version of Poetry Core to use"
3232
required: false
33-
default: ''
33+
default: ""
3434
BRANCH:
35-
description: 'Branch to publish from'
35+
description: "Branch to publish from"
3636
required: false
37-
default: 'master'
37+
default: "master"
3838
POETRY_DEPENDENCY_REGISTRY_URL:
39-
description: 'Allows to define a custom registry to be used by Poetry for dependency installation'
39+
description: "Allows to define a custom registry to be used by Poetry for dependency installation"
4040
required: false
4141
POETRY_DEPENDENCY_REGISTRY_NAME:
42-
description: 'The name used for the custom registry in the dependencies'
42+
description: "The name used for the custom registry in the dependencies"
4343
required: false
4444
POETRY_DEPENDENCY_REGISTRY_USERNAME:
45-
description: 'The username for the custom registry'
45+
description: "The username for the custom registry"
4646
required: false
4747
POETRY_DEPENDENCY_REGISTRY_PASSWORD:
48-
description: 'The password for the custom registry'
48+
description: "The password for the custom registry"
4949
required: false
5050
POETRY_DEPENDENCY_REGISTRY_AUTH:
51-
description: 'The authentication type for the custom registry'
51+
description: "The authentication type for the custom registry"
5252
required: false
53-
default: 'http-basic'
53+
default: "http-basic"
5454
PUBLISH_REGISTRY:
55-
description: 'The registry to publish to'
55+
description: "The registry to publish to"
5656
required: false
57-
default: 'https://upload.pypi.org/legacy/'
57+
default: "https://upload.pypi.org/legacy/"
5858

5959
runs:
60-
using: 'composite'
60+
using: composite
6161
steps:
6262
- name: Checkout Repository
6363
uses: actions/checkout@v3
@@ -66,19 +66,19 @@ runs:
6666
token: ${{ inputs.ACCESS_TOKEN }}
6767

6868
- name: Install poetry
69-
run: pip install poetry${{ inputs.POETRY_VERSION != '' && format('=={0}', inputs.POETRY_VERSION) || '' }} poetry-core${{ inputs.POETRY_CORE_VERSION != '' && format('=={0}', inputs.POETRY_CORE_VERSION) || '' }}
69+
run: pip install poetry${{ inputs.POETRY_VERSION != '' && format('=={0}', inputs.POETRY_VERSION) || '' }} poetry-core${{ inputs.POETRY_CORE_VERSION != '' && format('=={0}', inputs.POETRY_CORE_VERSION) || '' }}
7070
shell: bash
7171

7272
- name: Set up Python ${{ inputs.PYTHON_VERSION }}
7373
uses: actions/setup-python@v4
7474
with:
7575
python-version: ${{ inputs.PYTHON_VERSION }}
76-
cache: 'poetry'
76+
cache: poetry
7777
check-latest: true
7878

7979
- name: Set GitHub Tag as Package Version
8080
run: |
81-
echo __version__="'"${{ github.event.release.tag_name }}"'" > ${{ inputs.PACKAGE_DIRECTORY }}__init__.py
81+
sed -i -r 's/__version__ *= *".*"/__version__ = "${{ github.event.release.tag_name }}"/g' ${{ inputs.PACKAGE_DIRECTORY }}__init__.py
8282
sed -i '0,/version =.*/s//version = "'"${{ github.event.release.tag_name }}"'"/' ./pyproject.toml
8383
shell: bash
8484

0 commit comments

Comments
 (0)