From 5c8434d68eae46698bfb4be138e422f88483d1fd Mon Sep 17 00:00:00 2001 From: object-Object Date: Thu, 14 Sep 2023 23:46:59 -0400 Subject: [PATCH] Add new workflow updates to cookiecutter --- .../actions/install-artifact-wheel/action.yml | 6 +++++- .../.github/workflows/build_docs.yml | 16 +++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/doc/{{cookiecutter.output_directory}}/.github/actions/install-artifact-wheel/action.yml b/doc/{{cookiecutter.output_directory}}/.github/actions/install-artifact-wheel/action.yml index bf865426..f637b49e 100644 --- a/doc/{{cookiecutter.output_directory}}/.github/actions/install-artifact-wheel/action.yml +++ b/doc/{{cookiecutter.output_directory}}/.github/actions/install-artifact-wheel/action.yml @@ -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 %} diff --git a/doc/{{cookiecutter.output_directory}}/.github/workflows/build_docs.yml b/doc/{{cookiecutter.output_directory}}/.github/workflows/build_docs.yml index 26f8fbf3..7b5e58f5 100644 --- a/doc/{{cookiecutter.output_directory}}/.github/workflows/build_docs.yml +++ b/doc/{{cookiecutter.output_directory}}/.github/workflows/build_docs.yml @@ -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: