Add new workflow updates to cookiecutter

This commit is contained in:
object-Object 2023-09-14 23:46:59 -04:00
parent 0c7664251f
commit 5c8434d68e
2 changed files with 12 additions and 10 deletions

View file

@ -29,6 +29,10 @@ runs:
shell: bash
run: |
wheels=( _dist/*-py3-none-any.whl )
if [[ "$USE_TESTPYPI_INDEX" == true ]]; then
pip install "${wheels[0]}" --extra-index-url https://test.pypi.org/simple/
else
pip install "${wheels[0]}"
fi
rm -r _dist
{% endraw %}

View file

@ -33,7 +33,7 @@ on:
env:
PYPI_PACKAGE: {% endraw %}{{ cookiecutter.__project_name }}{% raw %}
USE_TESTPYPI_INDEX: true
USE_TESTPYPI_INDEX: false
permissions:
contents: read
@ -46,11 +46,6 @@ jobs:
build:
runs-on: ubuntu-latest
# only execute on the default branch or when invoked manually
if: |-
github.event_name == 'workflow_dispatch' ||
github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -116,7 +111,7 @@ jobs:
- name: Install docgen from source
run: |
if [[ $USE_TESTPYPI_INDEX ]]; then
if [[ "$USE_TESTPYPI_INDEX" == true ]]; then
pip install . hatch --extra-index-url https://test.pypi.org/simple/
else
pip install . hatch
@ -165,6 +160,9 @@ jobs:
name: github-pages-tmp
path: _site
- name: Add job summary
run: echo "Built \`${PYPI_PACKAGE}-$(hatch version)\` from \`$(git rev-parse --short "$GITHUB_SHA")\`." >> $GITHUB_STEP_SUMMARY
generate:
runs-on: ubuntu-latest
needs: build
@ -252,7 +250,7 @@ jobs:
publish-pypi:
runs-on: ubuntu-latest
needs: build
needs: [build, deploy-pages]
if: |-
needs.build.outputs.release == 'true' &&
(github.event_name != 'workflow_dispatch' || inputs.publish == 'PyPI (release)')
@ -276,7 +274,7 @@ jobs:
publish-testpypi:
runs-on: ubuntu-latest
needs: build
needs: [build, deploy-pages]
if: github.event_name == 'workflow_dispatch' && inputs.publish == 'TestPyPI'
environment: