Skip to content

Commit

Permalink
fix: cicd yaml typo
Browse files Browse the repository at this point in the history
  • Loading branch information
duttonw committed Oct 16, 2024
1 parent 140ee9e commit aa04ee6
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -131,15 +132,15 @@ 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
python -m build
- 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
Expand Down

0 comments on commit aa04ee6

Please sign in to comment.