Skip to content

Commit 3f396e1

Browse files
committed
Using workflow with a manual trigger
1 parent 5e8028a commit 3f396e1

File tree

2 files changed

+108
-108
lines changed

2 files changed

+108
-108
lines changed

.github/workflows/docs.yml

Lines changed: 87 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,94 @@
1-
name: Generate Docs
1+
# name: Generate Docs
2+
3+
# on:
4+
# push:
5+
# branches: [ stable ]
6+
# workflow_dispatch:
7+
8+
# jobs:
9+
# docs:
10+
# runs-on: ubuntu-latest
11+
# steps:
12+
# - uses: actions/checkout@v4
13+
# - name: Set up Python 3.9
14+
# uses: actions/setup-python@v5
15+
# with:
16+
# python-version: 3.9
17+
# - name: Build
18+
# run: |
19+
# sudo apt-get install pandoc
20+
# python -m pip install --upgrade pip
21+
# pip install -e .[dev]
22+
# make docs
23+
# - name: Deploy
24+
# uses: peaceiris/actions-gh-pages@v3
25+
# with:
26+
# github_token: ${{secrets.GITHUB_TOKEN}}
27+
# publish_dir: docs/_build/html
28+
name: Release
229

330
on:
4-
push:
5-
branches: [ stable ]
631
workflow_dispatch:
32+
inputs:
33+
candidate:
34+
description: 'If true, this creates a release candidate.'
35+
required: true
36+
type: boolean
37+
default: true
38+
test_pypi:
39+
description: 'If true, this will push to the test pypi instead of regular.'
40+
type: boolean
41+
default: false
742

843
jobs:
9-
docs:
44+
release:
1045
runs-on: ubuntu-latest
1146
steps:
12-
- uses: actions/checkout@v4
13-
- name: Set up Python 3.9
14-
uses: actions/setup-python@v5
15-
with:
16-
python-version: 3.9
17-
- name: Build
18-
run: |
19-
sudo apt-get install pandoc
20-
python -m pip install --upgrade pip
21-
pip install -e .[dev]
22-
make docs
23-
- name: Deploy
24-
uses: peaceiris/actions-gh-pages@v3
25-
with:
26-
github_token: ${{secrets.GITHUB_TOKEN}}
27-
publish_dir: docs/_build/html
47+
- uses: actions/checkout@v4
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: '3.13'
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
python -m pip install .[dev]
57+
58+
- name: Configure Git user
59+
run: |
60+
git config user.name "SDV Team"
61+
git config user.email "[email protected]"
62+
git remote set-url origin https://x-access-token:${{ secrets.GH_ACCESS_TOKEN }}@github.com/${{ github.repository }}
63+
64+
- name: Merge main to stable and push tags
65+
if: ${{ !inputs.candidate && !inputs.test_pypi }}
66+
run: |
67+
make check-release
68+
make git-merge-main-stable
69+
make bumpversion-release
70+
make git-push-tags-stable
71+
72+
- name: Create wheel
73+
run: |
74+
make check-main
75+
make dist
76+
77+
- name: Publish a Python distribution to PyPI
78+
uses: pypa/gh-action-pypi-publish@release/v1
79+
with:
80+
password: ${{ inputs.test_pypi && secrets.TEST_PYPI_API_TOKEN || secrets.PYPI_API_TOKEN }}
81+
repository-url: ${{ inputs.test_pypi && 'https://test.pypi.org/legacy/' || 'https://pypi.org' }}
82+
83+
- name: Bump to next candidate
84+
if: ${{ inputs.candidate && !inputs.test_pypi }}
85+
run: |
86+
make bumpversion-candidate
87+
make git-push
88+
89+
- name: Merge to main and bump to next patch
90+
if: ${{ !inputs.candidate && !inputs.test_pypi}}
91+
run: |
92+
make git-merge-stable-main
93+
make bumpversion-patch
94+
make git-push

.github/workflows/readme.yml

Lines changed: 21 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,26 @@
1-
# name: Test README
2-
3-
# on:
4-
# push:
5-
# pull_request:
6-
# types: [opened, reopened]
7-
8-
# jobs:
9-
# readme:
10-
# runs-on: ${{ matrix.os }}
11-
# strategy:
12-
# matrix:
13-
# python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
14-
# os: [ubuntu-latest, macos-latest]
15-
# steps:
16-
# - uses: actions/checkout@v1
17-
# - name: Set up Python ${{ matrix.python-version }}
18-
# uses: actions/setup-python@v2
19-
# with:
20-
# python-version: ${{ matrix.python-version }}
21-
# - name: Install dependencies
22-
# run: |
23-
# python -m pip install --upgrade pip
24-
# python -m pip install invoke tomli rundoc .
25-
# - name: Run the README.md
26-
# run: invoke readme
27-
name: Release
1+
name: Test README
282

293
on:
30-
workflow_dispatch:
31-
inputs:
32-
candidate:
33-
description: 'If true, this creates a release candidate.'
34-
required: true
35-
type: boolean
36-
default: true
37-
test_pypi:
38-
description: 'If true, this will push to the test pypi instead of regular.'
39-
type: boolean
40-
default: false
4+
push:
5+
pull_request:
6+
types: [opened, reopened]
417

428
jobs:
43-
release:
44-
runs-on: ubuntu-latest
9+
readme:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
14+
os: [ubuntu-latest, macos-latest]
4515
steps:
46-
- uses: actions/checkout@v4
47-
- name: Set up Python
48-
uses: actions/setup-python@v5
49-
with:
50-
python-version: '3.13'
51-
52-
- name: Install dependencies
53-
run: |
54-
python -m pip install --upgrade pip
55-
python -m pip install .[dev]
56-
57-
- name: Configure Git user
58-
run: |
59-
git config user.name "SDV Team"
60-
git config user.email "[email protected]"
61-
git remote set-url origin https://x-access-token:${{ secrets.GH_ACCESS_TOKEN }}@github.com/${{ github.repository }}
62-
63-
- name: Merge main to stable and push tags
64-
if: ${{ !inputs.candidate && !inputs.test_pypi }}
65-
run: |
66-
make check-release
67-
make git-merge-main-stable
68-
make bumpversion-release
69-
make git-push-tags-stable
70-
71-
- name: Create wheel
72-
run: |
73-
make check-main
74-
make dist
75-
76-
- name: Publish a Python distribution to PyPI
77-
uses: pypa/gh-action-pypi-publish@release/v1
78-
with:
79-
password: ${{ inputs.test_pypi && secrets.TEST_PYPI_API_TOKEN || secrets.PYPI_API_TOKEN }}
80-
repository-url: ${{ inputs.test_pypi && 'https://test.pypi.org/legacy/' || 'https://pypi.org' }}
81-
82-
- name: Bump to next candidate
83-
if: ${{ inputs.candidate && !inputs.test_pypi }}
84-
run: |
85-
make bumpversion-candidate
86-
make git-push
87-
88-
- name: Merge to main and bump to next patch
89-
if: ${{ !inputs.candidate && !inputs.test_pypi}}
90-
run: |
91-
make git-merge-stable-main
92-
make bumpversion-patch
93-
make git-push
16+
- uses: actions/checkout@v1
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install invoke tomli rundoc .
25+
- name: Run the README.md
26+
run: invoke readme

0 commit comments

Comments
 (0)