merge queue: embarking main (ffbcc13) and #1611 together #1632
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Manage artifacts and releases | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
on: | |
pull_request: | |
branches: [main] | |
types: [opened, reopened, synchronize, unlocked] | |
push: | |
branches: [main] | |
jobs: | |
prepare-release: | |
if: github.actor != 'dependabot[bot]' && github.event_name == 'push' | |
name: Prepare a new release | |
outputs: | |
release_created: ${{ steps.release-please.outputs.release_created }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: GoogleCloudPlatform/[email protected] | |
id: release-please | |
with: | |
bump-minor-pre-major: true | |
bump-patch-for-minor-pre-major: true | |
pull-request-title-pattern: "chore(release): project_name ${version}" | |
release-type: python | |
build-docs: | |
if: github.actor != 'dependabot[bot]' | |
name: Build the static site | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- id: setup-python | |
uses: actions/[email protected] | |
with: | |
cache: pip | |
cache-dependency-path: .github/requirements-docs.lock | |
check-latest: true | |
python-version: 3.11 | |
- run: python -m pip config --user set install.use-pep517 true | |
- run: python -m pip install -r .github/requirements-docs.lock | |
- run: python -m pip install -e ".[dev, stable]" | |
- uses: actions/[email protected] | |
with: | |
check-latest: true | |
node-version: 20.8 | |
- run: corepack enable | |
- run: corepack prepare yarn@stable --activate | |
- uses: actions/[email protected] | |
with: | |
key: ${{ hashFiles('docs/yarn.lock') }} | |
path: docs/.yarn/cache | |
- run: yarn install | |
working-directory: docs | |
- run: yarn build | |
working-directory: docs | |
- uses: actions/[email protected] | |
with: | |
name: static-site--${{ github.sha }} | |
path: docs/.vuepress/dist | |
build-rolling: | |
if: github.actor != 'dependabot[bot]' | |
name: Build the rolling release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
cache: pip | |
cache-dependency-path: .github/requirements-ci.lock | |
check-latest: true | |
python-version: 3.11 | |
- run: python -m pip config --user set install.use-pep517 true | |
- run: python -m pip install -r .github/requirements-ci.lock | |
- run: python -m build | |
- uses: actions/[email protected] | |
with: | |
name: rolling-release-dist--${{ github.sha }} | |
path: dist | |
deploy-docs: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
if: needs.prepare-release.outputs.release_created | |
name: Deploy the static site on GitHub Pages | |
needs: [prepare-release, build-docs, build-rolling] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
name: static-site--${{ github.sha }} | |
path: docs/.vuepress/dist | |
- uses: actions/[email protected] | |
with: | |
path: docs/.vuepress/dist | |
- id: deployment | |
uses: actions/[email protected] | |
deploy-release: | |
if: needs.prepare-release.outputs.release_created | |
name: Publish on PyPi | |
needs: [prepare-release, build-docs, build-rolling] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
cache: pip | |
cache-dependency-path: .github/requirements-ci.lock | |
check-latest: true | |
python-version: 3.11 | |
- run: python -m pip config --user set install.use-pep517 true | |
- run: python -m pip install -r .github/requirements-ci.lock | |
- run: python -m hatch publish | |
env: | |
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} | |
HATCH_INDEX_REPO: https://test.pypi.org/legacy/ | |
HATCH_INDEX_USER: __token__ |