diff --git a/.copier-answers.yaml b/.copier-answers.yaml index f4c2cff..110f4e4 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 9b579a3 +_commit: 6ce048e _src_path: https://github.com/python-project-templates/base.git add_docs: true add_extension: rust diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f514a36..c920e83 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -97,6 +97,20 @@ jobs: CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0 if: matrix.os != 'ubuntu-latest' + - name: Test wheel install + run: | + python -m venv /tmp/test-wheel + /tmp/test-wheel/bin/pip install dist/*.whl + /tmp/test-wheel/bin/python -c "import python_template_rust" + if: matrix.os == 'ubuntu-latest' + + - name: Test sdist install + run: | + python -m venv /tmp/test-sdist + /tmp/test-sdist/bin/pip install dist/*.tar.gz + /tmp/test-sdist/bin/python -c "import python_template_rust" + if: matrix.os == 'ubuntu-latest' + - uses: actions/upload-artifact@v7 with: name: dist-${{matrix.os}} diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3fdb494..ef0fd1f 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,22 +1,46 @@ name: Publish Docs on: - push: - branches: - - main + workflow_run: + workflows: ["Build Status"] + branches: [main] + types: [completed] workflow_dispatch: + permissions: + actions: read contents: write + jobs: docs: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} steps: - uses: actions/checkout@v6 - uses: actions-ext/python/setup@main - - uses: actions-ext/rust/setup@main - - run: uv pip install .[develop] - - run: uv pip install yardang + + - name: Download dist from build + uses: actions/download-artifact@v7 + with: + name: dist-ubuntu-latest + path: dist + run-id: ${{ github.event.workflow_run.id }} + if: github.event_name == 'workflow_run' + + - name: Install from wheel + run: | + uv pip install dist/*.whl + uv pip install yardang + if: github.event_name == 'workflow_run' + + - name: Install from source (manual trigger) + run: | + uv pip install .[develop] + uv pip install yardang + if: github.event_name == 'workflow_dispatch' + - run: yardang build + - uses: peaceiris/actions-gh-pages@v4 with: publish_branch: gh-pages