Skip to content

Commit 3d7a30f

Browse files
authored
Merge pull request #3028 from PMEAL/dev
Minor release: v3.6.0 #minor
2 parents dd63329 + 570eb85 commit 3d7a30f

312 files changed

Lines changed: 74021 additions & 73310 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bump-version-dev.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/bump-version.yml

Lines changed: 44 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,52 @@
1-
name: Bump Version (release)
1+
name: Bump Version
22

33
on:
44
push:
5-
branches:
6-
- release
5+
branches: [dev, release]
76

87
jobs:
9-
build:
10-
name: Bump version
8+
bump:
9+
if: ${{ !contains(github.event.head_commit.message, '[skip bump]') }}
1110
runs-on: ubuntu-latest
1211

1312
steps:
14-
- uses: actions/checkout@v3
15-
with:
16-
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
17-
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
18-
19-
- name: Set up Python
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: '3.9'
23-
24-
- name: Set env variables
25-
run: |
26-
# The next line is very important, otherwise the line after triggers
27-
# git to track the permission change, which breaks bump2version API (needs clean git folder)
28-
git config core.filemode false
29-
chmod +x .github/workflows/utils.sh
30-
echo "VERSION_FILE=openpnm/__version__.py" >> $GITHUB_ENV
31-
echo "SETUP_CFG_FILE=setup.cfg" >> $GITHUB_ENV
32-
echo "${{ github.event.head_commit.message }}"
33-
34-
- name: Install dependencies
35-
run: |
36-
pip install bump2version
37-
38-
- name: Bump version (patch)
39-
if: contains(github.event.head_commit.message, '#patch')
40-
run: |
41-
source .github/workflows/utils.sh
42-
bump_version patch $VERSION_FILE
43-
echo "TAG_NEW=v$(get_version $VERSION_FILE)" >> $GITHUB_ENV
44-
45-
- name: Bump version (minor)
46-
if: contains(github.event.head_commit.message, '#minor')
47-
run: |
48-
source .github/workflows/utils.sh
49-
bump_version minor $VERSION_FILE
50-
echo "TAG_NEW=v$(get_version $VERSION_FILE)" >> $GITHUB_ENV
51-
52-
- name: Bump version (major)
53-
if: contains(github.event.head_commit.message, '#major')
54-
run: |
55-
source .github/workflows/utils.sh
56-
bump_version major $VERSION_FILE
57-
echo "TAG_NEW=v$(get_version $VERSION_FILE)" >> $GITHUB_ENV
58-
59-
- name: Strip .dev0 suffix from version file
60-
if:
61-
contains(github.event.head_commit.message, '#patch') ||
62-
contains(github.event.head_commit.message, '#minor') ||
63-
contains(github.event.head_commit.message, '#major')
64-
run: |
65-
# Remove .dev0 suffix from the version file for releases
66-
sed -i "s/\.dev0'/'/g" $VERSION_FILE
67-
echo "Release version: $(cat $VERSION_FILE)"
68-
69-
- name: Commit files
70-
if:
71-
contains(github.event.head_commit.message, '#patch') ||
72-
contains(github.event.head_commit.message, '#minor') ||
73-
contains(github.event.head_commit.message, '#major')
74-
run: |
75-
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
76-
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PUSH_ACTION_TOKEN }}@github.com/${REPOSITORY}.git"
77-
78-
git config --local user.email "action@github.com"
79-
git config --local user.name "GitHub Action"
80-
81-
# Commit version bump to release
82-
git commit -m "Bump version number" -a
83-
git push "${remote_repo}" release
84-
85-
- name: Create Pull Request to merge back release into dev
86-
uses: repo-sync/pull-request@v2
87-
with:
88-
source_branch: "release" # If blank, default: triggered branch
89-
destination_branch: "dev" # If blank, default: master
90-
pr_title: "Merge release branch back into dev"
91-
pr_body: "Changes made to the release branch (e.g. hotfixes), plus the version bump."
92-
pr_assignee: "jgostick,ma-sadeghi" # Comma-separated list (no spaces)
93-
pr_label: "high priority" # Comma-separated list (no spaces)
94-
pr_draft: false # Creates pull request as draft
95-
pr_allow_empty: true # Creates pull request even if there are no changes
96-
github_token: ${{ secrets.GITHUB_TOKEN }}
97-
98-
- name: Trim the 4th digit from the tag
99-
run:
100-
echo "TAG_NEW=${TAG_NEW%.dev?}" >> $GITHUB_ENV
101-
102-
- name: Create new tag
103-
run: |
104-
REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
105-
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PUSH_ACTION_TOKEN }}@github.com/${REPOSITORY}.git"
106-
if [ -z "$TAG_NEW" ]
107-
then
108-
echo "New tag not created."
109-
else
110-
git tag $TAG_NEW
111-
git push "${remote_repo}" $TAG_NEW
112-
echo "Pushed a new tag: $TAG_NEW"
113-
fi
13+
- uses: actions/checkout@v6
14+
with:
15+
token: ${{ secrets.PAT }}
16+
fetch-depth: 0
17+
18+
- uses: astral-sh/setup-uv@v7
19+
with:
20+
python-version: "3.12"
21+
enable-cache: false
22+
23+
- name: Configure Git
24+
run: |
25+
git config user.name "GitHub Action"
26+
git config user.email "action@github.com"
27+
28+
- name: Bump version (dev)
29+
if: github.ref == 'refs/heads/dev'
30+
run: |
31+
uvx bump-my-version bump pre_n --no-tag
32+
git push
33+
34+
- name: Bump version (release)
35+
if: github.ref == 'refs/heads/release'
36+
run: |
37+
if [[ "${{ github.event.head_commit.message }}" == *"#patch"* ]]; then
38+
uvx bump-my-version bump patch
39+
elif [[ "${{ github.event.head_commit.message }}" == *"#minor"* ]]; then
40+
uvx bump-my-version bump minor
41+
elif [[ "${{ github.event.head_commit.message }}" == *"#major"* ]]; then
42+
uvx bump-my-version bump major
43+
fi
44+
git push --follow-tags
45+
46+
- name: Merge release back into dev
47+
if: github.ref == 'refs/heads/release'
48+
run: |
49+
git fetch origin dev
50+
git checkout dev
51+
git merge --no-ff origin/release -m "maint: merge release into dev [skip bump]"
52+
git push origin dev

.github/workflows/cleanup-tags.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/examples.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- release
8+
9+
jobs:
10+
deploy-docs:
11+
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
shell: bash -l {0}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
23+
with:
24+
enable-cache: true
25+
cache-dependency-glob: "**/pyproject.toml"
26+
python-version: '3.12'
27+
28+
- name: Install dependencies
29+
run: |
30+
uv sync --group docs --group interactive
31+
32+
- name: Build the documentation
33+
run: |
34+
cd docs
35+
uv run make html
36+
37+
- name: Publish the documentation to GitHub Pages
38+
uses: peaceiris/actions-gh-pages@v4
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_dir: ./docs/_build/html
42+
cname: openpnm.org
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release Notes
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
jobs:
10+
build:
11+
name: Release notes
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Generate changelog
21+
id: changelog
22+
run: |
23+
git fetch --all --tags --force
24+
chmod +x .github/workflows/logger.sh
25+
chmod +x .github/workflows/utils.sh
26+
source .github/workflows/utils.sh
27+
bash .github/workflows/logger.sh
28+
echo "TAG=$(get_most_recent_tag)" >> $GITHUB_OUTPUT
29+
30+
- name: Create GitHub release
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
gh release create "${{ steps.changelog.outputs.TAG }}" \
35+
--title "${{ steps.changelog.outputs.TAG }}" \
36+
--notes-file CHANGELOG.md \
37+
--draft

0 commit comments

Comments
 (0)