diff --git a/action.yml b/action.yml index 8dcb061..03e0279 100644 --- a/action.yml +++ b/action.yml @@ -41,16 +41,16 @@ inputs: Publish to PyPi Default is false default: false - test_publish: + pypi_custom_publish: description: | Publish to PyPi Default is false default: false - publish_url: + pypi_repo: description: | PyPi Target. Use this to point to private or test locations. - Default https://test.pypi.org/legacy/ - default: 'https://test.pypi.org/legacy/' + Default testpypi + default: 'testpypi' pypi_password: description: | Credentials for PyPi @@ -139,28 +139,24 @@ runs: python -m pytest '${{ inputs.pytest_markers }}' tests shell: bash - - name: Publish to PyPi - if: ${{ inputs.pypi_publish == 'true' }} - uses: etils-actions/pypi-build-publish@v1 - with: - pypi-token: ${{ inputs.pypi_password }} - - - if: ${{ inputs.test_publish == 'true' }} - uses: actions/setup-python@v2.2.2 + - uses: actions/setup-python@v2.2.2 with: python-version: 3.7 - - if: ${{ inputs.test_publish == 'true' }} - run: | + - run: | python -m pip install --upgrade pip - python -m pip install wheel twine - shell: bash - - name: Publish to PyPi at ${{ inputs.publish_url }} - if: ${{ inputs.test_publish == 'true' }} - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ inputs.pypi_password }} - repository_url: ${{ inputs.publish_url }} + python -m pip install flit + + if ["${{ inputs.pypi_publish }}" == 'true' ]; then + python -m flit publish + fi + + if ["${{ inputs.pypi_custom_publish }}" == 'true' ]; then + python -m flit publish --repository ${{ inputs.pypi_repo }} + fi + env: + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ inputs.pypi_password }} + shell: bash # Ref: https://haya14busa.github.io/github-action-brandings/ branding: