Skip to content

Commit 161d728

Browse files
committed
split release CI
1 parent b6a3d70 commit 161d728

File tree

7 files changed

+105
-20
lines changed

7 files changed

+105
-20
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--- Thank you for submitting a Pull Request! In order to make our work smoother, please make sure your Pull Request meets the following requirements: 1. Provide a general summary of your changes in the Title above; 2. Add appropriate prefixes to titles, such as `build:`, `chore:`, `ci:`, `deps:`, `doc:`, `docs:`, `feat:`, `fix:`, `perf:`, `ref:`, `refactor:`, `revert:`, `style:`, `test:`, `tests:`. -->
1+
<!--- Thank you for submitting a Pull Request! In order to make our work smoother, please make sure your Pull Request meets the following requirements: 1. Provide a general summary of your changes in the Title above; 2. Add appropriate prefixes to titles, such as `build:`, `chore:`, `ci:`, `docs:`, `feat:`, `fix:`, `perf:`, `refactor:`, `revert:`, `style:`, `test:`(Ref: https://www.conventionalcommits.org/). -->
22

33
## Description
44
<!--- Describe your changes in detail -->

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
concurrency:
2+
cancel-in-progress: true
3+
group: ${{ github.workflow }}-${{ github.ref }}
4+
jobs:
5+
ci:
6+
if: ${{ !cancelled() && ! failure() }}
7+
needs: dependabot
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: checkout
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
submodules: recursive
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v5
17+
with:
18+
cache: pip
19+
python-version: ${{ matrix.python-version }}
20+
- run: env | sort
21+
- run: make dev
22+
- name: lint test docs and build
23+
run: make lint docs-gen # test docs build
24+
strategy:
25+
matrix:
26+
python-version:
27+
- '3.10'
28+
- '3.11'
29+
dependabot:
30+
if: ${{ github.actor == 'dependabot[bot]' && startsWith(github.head_ref, 'dependabot/pip/') }}
31+
permissions:
32+
contents: write
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
ref: ${{ github.head_ref }}
39+
- name: Set up Git
40+
run: |
41+
git config --global user.name github-actions
42+
git config --global user.email [email protected]
43+
- name: Set up Python with multiple versions.
44+
uses: actions/setup-python@v5
45+
with:
46+
cache: pip
47+
python-version: |
48+
3.10
49+
3.11
50+
- name: Install pipenv using pipx
51+
run: pipx install pipenv
52+
- name: Generate constraints for all supported Python versions
53+
run: |
54+
CI= PYTHON_VERSION=3.10 make constraints
55+
CI= PYTHON_VERSION=3.11 make constraints
56+
- name: Push changes if applicable
57+
run: |
58+
if [[ -n `git status --porcelain` ]]; then
59+
git commit -a -m "build: Update constraints for dependabot."
60+
git push
61+
fi
62+
name: CI
63+
on:
64+
pull_request:
65+
types:
66+
- opened
67+
- synchronize
68+
push:
69+
branches:
70+
- main

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
steps:
88
- name: Check PR Title for Conventional Commit Format
99
run: |
10-
if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|deps|doc|docs|feat|fix|perf|ref|refactor|revert|style|test|tests|Bump version)(\(\w+\))?!?:\s.*'; then
10+
if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then
1111
echo 'The title does not conform to the Conventional Commit.'
1212
echo 'Please refer to "https://www.conventionalcommits.org/"'
1313
exit 1

.github/workflows/release.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,7 @@ jobs:
3131
- name: Release please
3232
uses: googleapis/release-please-action@v4
3333
with:
34+
# The current PAT (personal access token) was created on 2024-08-05,
35+
# since the maximum validity of PAT is 1 year, you need to change the PAT before 2025-08-05.
3436
token: ${{ secrets.PAT }}
3537
release-type: simple
36-
# package:
37-
# needs: release
38-
# runs-on: ubuntu-latest
39-
# steps:
40-
# - uses: actions/checkout@v4
41-
# - name: Set up Python
42-
# uses: actions/setup-python@v5
43-
# with:
44-
# cache: pip
45-
# python-version: '3.10'
46-
# - run: env | sort
47-
# - run: make dev
48-
# - run: make build
49-
# - env:
50-
# TWINE_USERNAME: __token__
51-
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
52-
# run: |
53-
# make upload

.github/workflows/upload.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Package and upload to pypi
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
jobs:
7+
# package:
8+
# if: |
9+
# github.event.pull_request.merged == true &&
10+
# startsWith(github.event.pull_request.title, 'chore(main): release')
11+
# needs: release
12+
# runs-on: ubuntu-latest
13+
# steps:
14+
# - uses: actions/checkout@v4
15+
# - name: Set up Python
16+
# uses: actions/setup-python@v5
17+
# with:
18+
# cache: pip
19+
# python-version: '3.10'
20+
# - run: env | sort
21+
# - run: make dev
22+
# - run: make build
23+
# - env:
24+
# TWINE_USERNAME: __token__
25+
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
26+
# run: |
27+
# make upload

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ build-backend = "setuptools.build_meta"
33
requires = [
44
"setuptools",
55
"setuptools-scm",
6+
"wheel",
67
]
78

89
[project]
@@ -108,6 +109,8 @@ package = {file = ["requirements/package.txt"]}
108109
test = {file = ["requirements/test.txt"]}
109110

110111
[tool.setuptools_scm]
112+
version_scheme = "post-release"
113+
local_scheme = "no-local-version"
111114

112115
[tool.tomlsort]
113116
all = true

requirements/package.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
build
33
setuptools-scm
44
twine
5+
wheel

0 commit comments

Comments
 (0)