Skip to content

Commit 3534dcb

Browse files
ma-sadeghiclaude
andauthored
Refactor CI/CD to mirror PoreSpy setup (#3029) #maint
Co-authored-by: Claude <noreply@anthropic.com>
1 parent e531466 commit 3534dcb

22 files changed

+3027
-1763
lines changed

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

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

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

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

.github/workflows/bump-version.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Bump Version
2+
3+
on:
4+
push:
5+
branches: [dev, release]
6+
7+
jobs:
8+
bump:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v6
13+
with:
14+
token: ${{ secrets.PAT }}
15+
fetch-depth: 0
16+
17+
- uses: astral-sh/setup-uv@v7
18+
with:
19+
python-version: "3.12"
20+
enable-cache: false
21+
22+
- name: Configure Git
23+
run: |
24+
git config user.name "GitHub Action"
25+
git config user.email "action@github.com"
26+
27+
- name: Bump version (dev)
28+
if: github.ref == 'refs/heads/dev'
29+
run: |
30+
uvx bump-my-version bump pre_n --no-tag
31+
git push
32+
33+
- name: Bump version (release)
34+
if: github.ref == 'refs/heads/release'
35+
run: |
36+
if [[ "${{ github.event.head_commit.message }}" == *"#patch"* ]]; then
37+
uvx bump-my-version bump patch
38+
elif [[ "${{ github.event.head_commit.message }}" == *"#minor"* ]]; then
39+
uvx bump-my-version bump minor
40+
elif [[ "${{ github.event.head_commit.message }}" == *"#major"* ]]; then
41+
uvx bump-my-version bump major
42+
fi
43+
git push --follow-tags
44+
45+
- name: Merge release back into dev
46+
if: github.ref == 'refs/heads/release'
47+
run: |
48+
git fetch origin dev
49+
git checkout dev
50+
git merge --no-ff origin/release -m "Merge release into dev [no ci]"
51+
git push origin dev

.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

.github/workflows/gh-pages.yml

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

0 commit comments

Comments
 (0)