diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3f5238a3..9ec91422 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,19 +14,19 @@ on: options: - No - Yes - environment: - description: 'Deployment environment' - required: true - default: 'pypi' - type: choice - options: - - pypi - - testpypi - dryRun: - description: 'Dry Run deployment (set to false to deploy)' - required: true - type: boolean - default: true + environment: + description: 'Deployment environment' + required: true + default: 'pypi' + type: choice + options: + - pypi + - testpypi + dryRun: + description: 'Dry Run deployment (set to false to deploy)' + required: true + type: boolean + default: true @@ -97,15 +97,16 @@ jobs: needs: test permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing - name: Publish ${{ steps.version.outputs.repo_name }} @ ${{ steps.version.outputs.version }} to ${{ steps.version.outputs.url }} + name: Publish Package + runs-on: ubuntu-latest environment: name: ${{ github.event.inputs.environment }} url: ${{ steps.version.outputs.url }} concurrency: group: ${{ github.event.inputs.environment }}-deployment cancel-in-progress: false - steps: + steps: - name: Get Git Tag and set url from environment id: version run: | @@ -116,13 +117,13 @@ jobs: echo "version=${TAG_VALUE}" >> $GITHUB_ENV # Extract the repository name (minus the owner/org) - repo_name=$(basename $GITHUB_REPOSITORY) - echo "repo_name=${repo_name}" >> $GITHUB_OUTPUT + reponame=$(basename $GITHUB_REPOSITORY) + echo "reponame=${reponame}" >> $GITHUB_OUTPUT if [ "$ENVIRONMENT" == "pypi" ]; then - url="https://pypi.com/p/$repo_name" + url="https://pypi.com/p/$reponame" elif [ "$1" == "testpypi" ]; then - url="https://test.pypi.com/p/$repo_name" + url="https://test.pypi.com/p/$reponame" else url="" fi @@ -131,7 +132,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Build package ${{ steps.version.outputs.repo_name }} @ ${{ steps.version.outputs.version }} + - name: Build package ${{ steps.version.outputs.reponame }} @ ${{ steps.version.outputs.version }} run: | pip install build pip install twine @@ -139,7 +140,7 @@ jobs: - name: Publish package distributions to PyPI if: ${{ startsWith(github.ref, 'refs/tags') && (github.event.inputs.environment == 'pypi' || github.event.inputs.environment == 'publish' ) && github.event.inputs.dryRun == 'false'}} uses: pypa/gh-action-pypi-publish@release/v1 - with: +# with: # skip-existing: true # verbose: true # print-hash: true