Add new workflow updates to cookiecutter
This commit is contained in:
parent
0c7664251f
commit
5c8434d68e
2 changed files with 12 additions and 10 deletions
|
@ -29,6 +29,10 @@ runs:
|
|||
shell: bash
|
||||
run: |
|
||||
wheels=( _dist/*-py3-none-any.whl )
|
||||
pip install "${wheels[0]}"
|
||||
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 %}
|
||||
|
|
|
@ -33,7 +33,7 @@ on:
|
|||
|
||||
env:
|
||||
PYPI_PACKAGE: {% endraw %}{{ cookiecutter.__project_name }}{% raw %}
|
||||
USE_TESTPYPI_INDEX: true
|
||||
USE_TESTPYPI_INDEX: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
@ -45,11 +45,6 @@ concurrency:
|
|||
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
|
||||
|
@ -164,6 +159,9 @@ jobs:
|
|||
with:
|
||||
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
|
||||
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue