Skip to content

Commit 63d28a5

Browse files
committed
adding some more automation
1 parent 950de20 commit 63d28a5

File tree

11 files changed

+313
-48
lines changed

11 files changed

+313
-48
lines changed

Diff for: .github/ISSUE_TEMPLATE/bug_report.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: This is a template for reporting a bug.
33
# If you want to enable automatic linking to projects,
44
# uncomment the following line and replace the project ID
55
# with the ID of your project.
6-
# projects: ["childmindresearch/1"]
6+
# projects: ["pipepal"]
77
title: 'Bug: '
88
labels: [bug]
99
body:

Diff for: .github/ISSUE_TEMPLATE/development_task.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: This is a template for a development task
33
# If you want to enable automatic linking to projects,
44
# uncomment the following line and replace the project ID
55
# with the ID of your project.
6-
# projects: ["childmindresearch/1"]
6+
# projects: ["pipepal"]
77
title: 'Task: '
88
labels: [task]
99
body:

Diff for: .github/ISSUE_TEMPLATE/general.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Other
2+
description: This is a template for reporting a general issue.
3+
# If you want to enable automatic linking to projects,
4+
# uncomment the following line and replace the project ID
5+
# with the ID of your project.
6+
# projects: ["pipepal"]
7+
title: ''
8+
labels: [other]
9+
body:
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: Text
14+
description: Please, provide a clear and concise piece of information.
15+
placeholder: Please, provide a clear and concise piece of information.
16+
validations:
17+
required: false

Diff for: .github/ISSUE_TEMPLATE/support_request.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: This is a template for submitting a support request.
33
# If you want to enable automatic linking to projects,
44
# uncomment the following line and replace the project ID
55
# with the ID of your project.
6-
# projects: ["childmindresearch/1"]
6+
# projects: ["pipepal"]
77
title: 'Support: '
88
labels: [question]
99
body:

Diff for: .github/PULL_REQUEST_TEMPLATE/advanced.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Advanced Pull Request Template
2+
3+
## Description
4+
Briefly describe the changes you've made.
5+
6+
## Related Issue(s)
7+
Link any related issues here.
8+
9+
## Motivation and Context
10+
Explain why these changes are necessary and what problem they solve.
11+
12+
## How Has This Been Tested?
13+
Describe how you have tested these changes.
14+
15+
## Screenshots (if appropriate):
16+
Include any relevant screenshots.
17+
18+
## Types of changes
19+
- [ ] Bug fix (non-breaking change which fixes an issue)
20+
- [ ] New feature (non-breaking change which adds functionality)
21+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
22+
23+
## Checklist:
24+
- [ ] My code follows the code style of this project.
25+
- [ ] I have added tests to cover my changes.
26+
- [ ] All new and existing tests passed.

Diff for: .github/PULL_REQUEST_TEMPLATE/basic.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Basic Pull Request Template
2+
3+
## Description
4+
Briefly describe the changes you've made.

Diff for: .github/dependabot.yaml

+22-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
# Please see the documentation for all configuration options:
22
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
33

4+
# Dependabot configuration for updating dependencies and GitHub Actions
45
version: 2
56
updates:
6-
- package-ecosystem: pip
7-
directory: /
8-
schedule:
9-
interval: monthly
10-
groups:
11-
production-dependencies:
12-
dependency-type: production
13-
development-dependencies:
14-
dependency-type: development
15-
- package-ecosystem: github-actions
16-
directory: /
17-
schedule:
18-
interval: monthly
7+
# Configuration for Python package updates using pip
8+
- package-ecosystem: pip
9+
directory: "/"
10+
schedule:
11+
interval: monthly
12+
open-pull-requests-limit: 5
13+
groups:
14+
production-dependencies:
15+
dependency-type: production
16+
development-dependencies:
17+
dependency-type: development
18+
19+
# Configuration for GitHub Actions updates
20+
- package-ecosystem: github-actions
21+
directory: "/"
22+
schedule:
23+
interval: monthly
24+
open-pull-requests-limit: 5
25+
26+
# Enable automatic security updates
27+
security_updates: true

Diff for: .github/workflows/docs.yaml

+64-15
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,83 @@
1-
name: Build and publish docs
1+
name: Build and Publish Docs
22

33
permissions:
44
contents: write
5+
pages: write
6+
id-token: write
57

68
on:
7-
workflow_run:
8-
workflows: [Python Tests]
9-
types:
10-
- completed
11-
branches:
12-
- main
9+
release:
10+
types: [published]
1311

1412
jobs:
15-
build-and-publish-docs:
16-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17-
runs-on: ubuntu-latest
13+
build-docs:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest]
19+
python-version: ["3.10"]
20+
include:
21+
- os: ubuntu-latest
22+
python-version: "3.10"
23+
deploy: true # Only deploy from this configuration
24+
outputs:
25+
deploy: ${{ steps.set-deploy-output.outputs.deploy }}
1826
steps:
1927
- uses: actions/checkout@v4
28+
with: # no need for the history
29+
fetch-depth: 0
2030
- uses: actions/setup-python@v5
2131
with:
22-
python-version-file: pyproject.toml
32+
python-version: ${{ matrix.python-version }}
33+
# Cache Poetry dependencies to speed up builds
34+
- name: Cache Poetry virtualenv
35+
uses: actions/cache@v3
36+
with:
37+
path: ~/.cache/pypoetry
38+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-poetry-
2341
- name: Install dependencies
2442
run: |
2543
python -m pip install poetry
2644
poetry install --with docs
45+
shell: bash
2746
- name: Build docs
2847
run: |
29-
APP_MODULE_NAME=$(ls src -U | head -1) # Get the first module name in the src directory
30-
poetry run pdoc src/"$APP_MODULE_NAME" -o docs_build -t docs/pdoc-theme --docformat google
31-
touch docs_build/.nojekyll
48+
APP_MODULE_NAME=$(ls src -U | head -1)
49+
poetry run pdoc src/"$APP_MODULE_NAME" -o docs -t docs_style/pdoc-theme --docformat google
50+
touch docs/.nojekyll
51+
shell: bash
52+
- name: Determine if deployment is needed
53+
id: set-deploy-output
54+
run: echo "::set-output name=deploy::true"
55+
shell: bash
56+
- uses: actions/upload-artifact@v3
57+
with:
58+
name: documentation
59+
path: docs
60+
61+
publish-docs:
62+
needs: build-docs
63+
if: ${{ needs.build-docs.outputs.deploy == 'true' }}
64+
runs-on: ${{ matrix.os }}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
os: [ubuntu-latest] # For demonstration, other OSes are commented out
69+
python-version: ["3.10"]
70+
include:
71+
- os: ubuntu-latest
72+
python-version: "3.10"
73+
deploy: true # Only deploy from this configuration
74+
steps:
75+
- uses: actions/checkout@v4
76+
- uses: actions/download-artifact@v3
77+
with:
78+
name: documentation
79+
path: docs
3280
- uses: JamesIves/github-pages-deploy-action@v4
3381
with:
34-
folder: docs_build
82+
folder: docs
83+
branch: docs

Diff for: .github/workflows/publish.yaml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
pypi-release:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest]
13+
python-version: ["3.10"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Includes getting tags
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install pipx and ensure it's up to date
23+
run: |
24+
python -m pip install --upgrade pipx
25+
pipx ensurepath
26+
shell: bash
27+
- name: Install poetry
28+
run: pipx install poetry
29+
shell: bash
30+
# Cache Poetry dependencies to speed up builds
31+
- name: Cache Poetry virtualenv
32+
uses: actions/cache@v3
33+
with:
34+
path: ~/.cache/pypoetry
35+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-poetry-
38+
- name: Install poetry dynamic versioning tool
39+
run: pipx inject poetry "poetry-dynamic-versioning[plugin]"
40+
shell: bash
41+
- name: Install dependencies with Poetry
42+
run: poetry install --with dev
43+
shell: bash
44+
- name: Build package
45+
run: poetry build
46+
shell: bash
47+
- name: Configure Poetry PyPI token
48+
run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
49+
shell: bash
50+
- name: Publish to PyPI
51+
env:
52+
POETRY_REQUESTS_TIMEOUT: 120
53+
run: poetry publish
54+
shell: bash
55+
56+
57+
58+

Diff for: .github/workflows/release.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Auto-release
2+
3+
on:
4+
# ATM, this is the closest trigger to a PR merging
5+
workflow_run:
6+
workflows: ["Python Tests"]
7+
branches: [main]
8+
types: [completed]
9+
10+
env:
11+
AUTO_VERSION: v11.1.2
12+
13+
jobs:
14+
auto-release:
15+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Prepare repository
22+
# Fetch full git history and tags
23+
run: git fetch --unshallow --tags
24+
25+
- name: Unset header
26+
# checkout@v2 adds a header that makes branch protection report errors
27+
# because the Github action bot is not a collaborator on the repo
28+
run: git config --local --unset http.https://github.com/.extraheader
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.10"
34+
35+
- name: Download auto
36+
run: |
37+
auto_download_url="$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/tags/$AUTO_VERSION | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')"
38+
wget -O- "$auto_download_url" | gunzip > ~/auto
39+
chmod a+x ~/auto
40+
41+
- name: Create release
42+
run: |
43+
~/auto shipit -vv
44+
env:
45+
GH_TOKEN: ${{ secrets.AUTO_ORG_TOKEN }}
46+

0 commit comments

Comments
 (0)