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
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
wheels=( _dist/*-py3-none-any.whl )
|
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
|
rm -r _dist
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
|
@ -33,7 +33,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYPI_PACKAGE: {% endraw %}{{ cookiecutter.__project_name }}{% raw %}
|
PYPI_PACKAGE: {% endraw %}{{ cookiecutter.__project_name }}{% raw %}
|
||||||
USE_TESTPYPI_INDEX: true
|
USE_TESTPYPI_INDEX: false
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -45,11 +45,6 @@ concurrency:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
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:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -116,7 +111,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install docgen from source
|
- name: Install docgen from source
|
||||||
run: |
|
run: |
|
||||||
if [[ $USE_TESTPYPI_INDEX ]]; then
|
if [[ "$USE_TESTPYPI_INDEX" == true ]]; then
|
||||||
pip install . hatch --extra-index-url https://test.pypi.org/simple/
|
pip install . hatch --extra-index-url https://test.pypi.org/simple/
|
||||||
else
|
else
|
||||||
pip install . hatch
|
pip install . hatch
|
||||||
|
@ -164,6 +159,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: github-pages-tmp
|
name: github-pages-tmp
|
||||||
path: _site
|
path: _site
|
||||||
|
|
||||||
|
- name: Add job summary
|
||||||
|
run: echo "Built \`${PYPI_PACKAGE}-$(hatch version)\` from \`$(git rev-parse --short "$GITHUB_SHA")\`." >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
generate:
|
generate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -252,7 +250,7 @@ jobs:
|
||||||
|
|
||||||
publish-pypi:
|
publish-pypi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: [build, deploy-pages]
|
||||||
if: |-
|
if: |-
|
||||||
needs.build.outputs.release == 'true' &&
|
needs.build.outputs.release == 'true' &&
|
||||||
(github.event_name != 'workflow_dispatch' || inputs.publish == 'PyPI (release)')
|
(github.event_name != 'workflow_dispatch' || inputs.publish == 'PyPI (release)')
|
||||||
|
@ -276,7 +274,7 @@ jobs:
|
||||||
|
|
||||||
publish-testpypi:
|
publish-testpypi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: [build, deploy-pages]
|
||||||
if: github.event_name == 'workflow_dispatch' && inputs.publish == 'TestPyPI'
|
if: github.event_name == 'workflow_dispatch' && inputs.publish == 'TestPyPI'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
Loading…
Reference in a new issue