diff --git a/{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml b/{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml index 9780a9c..d4090ba 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml +++ b/{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml @@ -4,15 +4,27 @@ on: push: branches: [main] +# Allow one concurent deployment +concurrency: + group: "pages" + cancel-in-progress: true + jobs: build-docs: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + # if running inside container, provide details here + # container: {} + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment permissions: contents: write # to let mkdocs write the new docs pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source + id-token: write # to verify deployment is from an appropriate source steps: - name: Checkout @@ -20,21 +32,48 @@ jobs: with: fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + - name: Setup Pages + uses: actions/configure-pages@v1 + + # try python3 version management - name: Set up Python. uses: actions/setup-python@v4 with: python-version: 3.9 - name: Install Poetry. - run: pipx install poetry + run: | + # run pip config here if required + # manage python3 version here if necessary + python3 -m pip install --user pipx + python3 -m pipx ensurepath + python3 -m pipx install poetry - name: Install dependencies. - run: poetry install -E docs + run: | + ${HOME}/.local/bin/poetry lock + ${HOME}/.local/bin/poetry install -E docs - - name: Build documentation. + - name: Build documentation (gh-pages branch) run: | + export PATH="${PATH}:${HOME}/.local/bin" mkdir -p docs touch docs/.nojekyll make gendoc ([ ! -f docs/about.md ] && cp src/docs/about.md docs/) || true make mkd-gh-deploy + + ## When your github organization does not use gh-pages branch, + ## use custom upload/deploy steps illustrated below + + # - name: Upload documentation (custom branch) + # uses: actions/upload-pages-artifact@v3 + # with: + # path: "${HOME}/work/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/site" + + # - name: Deploy documentation (custom branch) + # id: deployment + # uses: actions/deploy-pages@v4 + # env: + # OPENSSL_CONF: ./openssl.cnf # if needed + # NODE_OPTIONS: "--openssl-shared-config" diff --git a/{{cookiecutter.project_name}}/.github/workflows/main.yaml b/{{cookiecutter.project_name}}/.github/workflows/main.yaml index e09cd68..9abe865 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/main.yaml +++ b/{{cookiecutter.project_name}}/.github/workflows/main.yaml @@ -24,13 +24,27 @@ jobs: python-version: ${{ "{{" }} matrix.python-version {{ "}}" }} - name: Install Poetry - run: pipx install poetry + run: | + # run pip config here if required + python3 -m pip install --user pipx + python3 -m pipx ensurepath + python3 -m pipx install poetry - name: Install dependencies - run: poetry install --no-interaction --no-root + run: | + ${HOME}/.local/bin/poetry lock + ${HOME}/.local/bin/poetry install --no-interaction --no-root - name: Install project - run: poetry install --no-interaction + run: ${HOME}/.local/bin/poetry install --no-interaction + + - name: Run Linters + run: | + ${HOME}/.local/bin/poetry run linkml-lint src/{{cookiecutter.__project_slug}}/schema/{{cookiecutter.__project_slug}}.yaml --ignore-warnings - name: Run test suite - run: make test + run: | + export PATH="${PATH}:${HOME}/.local/bin" + poetry add requests[security] + make test + diff --git a/{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml b/{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml index 0cf5f15..61775e7 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml +++ b/{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml @@ -20,14 +20,19 @@ jobs: - name: Install Poetry run: | - pipx install poetry - poetry self add "poetry-dynamic-versioning[plugin]" + # run pip config here if needed + python3 -m pip install --user pipx + python3 -m pipx ensurepath + python3 -m pipx install poetry + ${HOME}/.local/bin/poetry self add "poetry-dynamic-versioning[plugin]" # - name: Install dependencies - # run: poetry install --no-interaction + # run: | + # ${HOME}/.local/bin/poetry lock + # ${HOME}/.local/bin/poetry install --no-interaction - name: Build source and wheel archives - run: poetry build + run: ${HOME}/.local/bin/poetry build - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@v1.2.2