Skip to content

Commit ced1613

Browse files
Merge pull request #69 from easyscience/patch
Minor updates of the tutorials
2 parents e7a8490 + c991421 commit ced1613

29 files changed

+134
-10226
lines changed

.github/release-drafter.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33

44
name-template: 'easydiffraction $RESOLVED_VERSION'
55
tag-template: 'v$RESOLVED_VERSION'
6+
67
categories:
78
- title: 'Added'
8-
labels: # Labels to use to categorize a pull request as a feature
9+
labels:
910
- '[scope] significant'
1011
- '[scope] enhancement'
11-
- '[scope] documentation'
1212
- title: 'Fixed'
13-
labels: # Labels to use to categorize a pull request as a bug fix
13+
labels:
1414
- '[scope] bug'
1515
- title: 'Changed'
16-
labels: # Labels to use to categorize a pull request as a maintenance task
16+
labels:
1717
- '[scope] maintenance'
18+
- title: 'Documentation'
19+
labels:
20+
- '[scope] documentation'
21+
1822
change-template: '- $TITLE (#$NUMBER)'
19-
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
23+
change-title-escapes: '\<*_&'
24+
2025
version-resolver:
2126
major:
2227
labels:
@@ -28,7 +33,21 @@ version-resolver:
2833
labels:
2934
- '[scope] bug'
3035
- '[scope] maintenance'
31-
- '[scope] documentation'
3236
default: patch
37+
38+
# Custom logic for documentation post-releases
39+
# This is a workaround because Release Drafter doesn’t natively support .postN
40+
# We'll append .postN via the version-template below
41+
# - If any merged PR has the [scope] documentation label, the version becomes previous_version.postN.
42+
# - Increment increases for each new .postN release.
43+
# - If no docs label is found, normal SemVer bumping applies.
44+
version-template: >
45+
{% if prs | selectattr("labels", "contains", "[scope] documentation") | list |
46+
length > 0 %}
47+
{{ previous_tag | replace("v","") }}.post{{ increment }}
48+
{% else %}
49+
$RESOLVED_VERSION
50+
{% endif %}
51+
3352
template: |
3453
$CHANGES

.github/workflows/build-docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ jobs:
202202
# To allow the deployment of the static files to GitHub Pages, no
203203
# restrictions on the branch name need to be set for desired branches on
204204
# https://github.com/easyscience/diffraction-lib/settings/environments
205-
# Currently, only develop and master branches are allowed to deploy to GitHub Pages
206205
# Deployed pages are available at https://easyscience.github.io/diffraction-lib
207206
- name:
208207
Deploy to easyscience.github.io/${{ github.event.repository.name }}

.github/workflows/draft-release-notes.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@
44
name: Update release draft
55

66
on:
7-
# Runs on pushes targeting the default branch
7+
# Runs on pushes targeting the default branch (updates the real draft release)
88
push:
99
branches:
1010
- main
1111
- master
1212

13+
# Runs on PRs targeting the default branch (dry-run testing; does NOT update the real draft)
14+
pull_request:
15+
branches:
16+
- main
17+
- master
18+
1319
jobs:
1420
draft-release-notes:
21+
if: ${{ github.event_name == 'push' }}
22+
1523
permissions:
1624
# write permission is required to create a github release
1725
contents: write
@@ -25,3 +33,22 @@ jobs:
2533
disable-autolabeler: true
2634
env:
2735
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
# Test the Release Drafter config on PRs without modifying the real draft release
38+
draft-release-notes-dry-run:
39+
if: ${{ github.event_name == 'pull_request' }}
40+
41+
permissions:
42+
contents: read
43+
pull-requests: read
44+
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Drafts the next Release notes (dry-run)
49+
uses: release-drafter/release-drafter@v6
50+
with:
51+
disable-autolabeler: true
52+
disable-releaser: true # prevents creating/updating the draft
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-tutorials.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
run: |
7070
jupytext ${{ env.NOTEBOOKS_DIR }}/*.py --from py:percent --to ipynb
7171
nbstripout ${{ env.NOTEBOOKS_DIR }}/*.ipynb
72+
python tools/prepare_notebooks.py ${{ env.NOTEBOOKS_DIR }}/
7273
7374
- name: Check Jupyter notebooks formatting
7475
id: check_notebooks

0 commit comments

Comments
 (0)