Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/documentation-deploy-development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build/Publish Latest Develop Docs

permissions: write-all

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build-docs-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.13

- name: Install dependencies
run: |
pip install ".[doc]"
- name: Setup Docs Deploy user
run: |
git config --global user.name "Docs Deploy"
git config --global user.email "docs.deploy@example.co.uk"
- name: Deploy mkdocs on GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME=${{ github.ref_name }}
MAJ_MIN_VERSION=${TAG_NAME%/*}
echo $MAJ_MIN_VERSION
mike deploy --push develop
34 changes: 34 additions & 0 deletions .github/workflows/documentation-deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build/Publish Latest Release Docs

permissions: write-all

on:
release:
types: [published]

jobs:
build-docs-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.13

- name: Install dependencies
run: |
pip install ".[doc]"
- name: Setup Docs Deploy user
run: |
git config --global user.name "Docs Deploy"
git config --global user.email "docs.deploy@example.co.uk"
- name: Deploy mkdocs on GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME=${{ github.event.release.tag_name }}
MAJ_MIN_VERSION=${TAG_NAME%.*}
mike deploy --push --update-aliases $MAJ_MIN_VERSION latest
27 changes: 0 additions & 27 deletions .github/workflows/documentation-deploy.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ coverage.xml
docs/_build
docs/apidocs

site

# ide
.idea
.eclipse
Expand Down
7 changes: 7 additions & 0 deletions .linkspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dirs:
- ./
useGitIgnore: true
excludedFiles:
- ./README.dev.md
ignorePatterns:
- pattern: "https://doi.org/.*"
21 changes: 21 additions & 0 deletions README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ mkdocs serve

This will return a URL (e.g. `http://127.0.0.1:8000/mibiscreen/`) where the docs site can be viewed.

Note that this will only create the "non-versioned" documentation, which should be fine for testing changes to the docs.
The versioned documentation is created using the python utility called [mike](https://github.com/jimporter/mike?tab=readme-ov-file#mike) and its corresponding [mkdocs integration](https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/).
In general it should not be necessary to test this, but if necessary, use [the mike documentation](https://github.com/jimporter/mike?tab=readme-ov-file#viewing-your-docs) to inspect locally.

## Versioning

Bumping the version across all files is done with [bump-my-version](https://github.com/callowayproject/bump-my-version), e.g.
Expand Down Expand Up @@ -154,3 +158,20 @@ This will create the release on github and automatically trigger:

1. The `.github/workflows/publish.yml` workflow which will build the package and publish it on PyPI
1. The Zenodo-Github integration into making a snapshot of your repository and sticking a DOI on it and adding the new version to the main Zenodo entry for your software at [10.5281/zenodo.10878799](https://doi.org/10.5281/zenodo.10878799)


## Getting a new `SONAR_TOKEN`
If the Sonar pipeline does not run for 60 days, the `SONAR_TOKEN` expires.
You can see the original announcement [in this thread](https://community.sonarsource.com/t/removing-inactive-tokens-after-60-days/142451/6).

The expiry happens silently, so any github action workflows using Sonar will appear to suddenly fail with cryptic errors such as `"ERROR Failed to query JRE metadata: . Please check the property sonar.token or the environment variable SONAR_TOKEN. "`. If you see this, it means you need to recreate the `SONAR_TOKEN` for this repository. You will need some admin privileges to carry out the following steps:

1. Go to 'My Account' on the sonarcloud.io site after logging in (or try following this URL: <https://sonarcloud.io/account>)
1. Click on the 'Security' tab (<https://sonarcloud.io/account/security>)
1. Enter a token name in the field under "Generate Tokens" and click "Generate Token"
1. Copy the text for the generated token (you will not be able to see this text again)
1. Go to the "Actions secrets and variables" section of the `mibiscreen` repository on GitHub (<https://github.com/MiBiPreT/mibiscreen/settings/secrets/actions>)
1. Edit the existing `SONAR_TOKEN` (or create it, if it does not exist). Paste in the token text you copied from sonarcloud earlier
1. Click "Update Secret"

This should result in the newly created `SONAR_TOKEN` being used in any new github workflow runs. You may also choose to rerun some previously failed workflows (these should now succeed).
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,7 @@ extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/MiBiPreT/mibiscreen
version:
provider: mike
default: latest
alias: true
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ doc = [
"mkdocstrings[python] ==0.27.0",
"mdx-include >=1.4.1",
"mkdocs-markdownextradata-plugin >=0.2.5",
"mike >=2.1.3",
]

[project.urls]
Expand Down
Loading