Skip to content

Commit 4fa54d0

Browse files
authored
✨ uv + task
1 parent 8192d3c commit 4fa54d0

Some content is hidden

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

78 files changed

+2446
-39114
lines changed

.github/dependabot.yaml

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

.github/semantic_release/package-lock.json

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

.github/semantic_release/package.json

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

.github/workflows/release.yaml

Lines changed: 30 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,50 @@
1-
name: Release
1+
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
22

3+
name: release
34
on:
45
push:
5-
branches:
6-
- main
6+
branches: [main, next, beta, alpha, "*.x"]
77

88
jobs:
99
release:
10-
name: github-release
10+
name: release
11+
if: github.repository_owner == 'juftin'
1112
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
issues: write
16+
pull-requests: write
1217
steps:
13-
- name: Check out the repository
14-
uses: actions/checkout@v4
18+
- name: checkout
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
- name: setup-uv
23+
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
24+
- name: Semantic Release
25+
uses: juftin/actions/semantic-release@v1
1526
with:
16-
fetch-depth: 2
17-
ref: main
18-
- name: Setup Node.js
19-
uses: actions/setup-node@v4
20-
- name: Release
21-
run: |
22-
npm install --prefix .github/semantic_release/
23-
npx --prefix .github/semantic_release/ semantic-release
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
26-
GIT_AUTHOR_NAME: github-actions[bot]
27-
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
28-
GIT_COMMITTER_NAME: github-actions[bot]
29-
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
3028

31-
github-pages-publish:
29+
docs:
30+
name: docs
3231
runs-on: ubuntu-latest
33-
needs: release
34-
if: github.repository_owner == 'juftin'
3532
permissions:
3633
pages: write
3734
id-token: write
3835
environment:
3936
name: github-pages
4037
url: ${{ steps.deployment.outputs.page_url }}
4138
steps:
42-
- name: Checkout Latest Changes
43-
uses: actions/checkout@v4
44-
with:
45-
ref: ${{ github.ref }}
46-
fetch-depth: 0
47-
- name: Set up Python Environment
48-
uses: actions/setup-python@v5
49-
with:
50-
python-version: "3.11"
51-
- name: Install Hatch
52-
run: |
53-
python -m pip install --upgrade pip wheel
54-
python -m pip install -q hatch pre-commit
55-
hatch --version
56-
- name: Create Virtual Environment
57-
run: hatch env create docs
58-
- name: Set Up GitHub Actions User
59-
run: |
60-
git config user.name "github-actions[bot]"
61-
git config user.email "github-actions[bot]@users.noreply.github.com"
62-
- name: Build Site
63-
run: hatch run docs:build
64-
- name: Setup GitHub Pages
65-
uses: actions/configure-pages@v4
66-
- name: Upload Artifact
67-
uses: actions/upload-pages-artifact@v3
39+
- name: build-docs
40+
uses: juftin/actions/taskfile@v1
6841
with:
69-
path: site/
70-
- name: Deploy to GitHub Pages
42+
checkout: true
43+
setup-uv: true
44+
task: docs
45+
install: true
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
args: build
48+
- name: Publish Docs
49+
uses: juftin/actions/github-pages@v1
7150
id: deployment
72-
uses: actions/deploy-pages@v4

.github/workflows/test.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
2+
3+
name: test
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
17+
pull-requests: write
18+
steps:
19+
- name: test
20+
uses: juftin/actions/taskfile@v1
21+
with:
22+
checkout: true
23+
setup-uv: true
24+
task: test
25+
install: true
26+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yaml

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

.pre-commit-config.yaml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
default_stages: [commit]
2-
fail_fast: false
1+
# yaml-language-server: $schema=https://schemastore.org/pre-commit-config.json
2+
33
exclude: |
44
(?x)(
55
{{cookiecutter.repo_name}}/|
6-
test/example-project/
6+
tests/example-project/
77
)
8+
89
repos:
910
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.5.0
11+
rev: v6.0.0
1112
hooks:
1213
- id: trailing-whitespace
1314
- id: end-of-file-fixer
@@ -18,27 +19,28 @@ repos:
1819
- id: check-merge-conflict
1920
- id: mixed-line-ending
2021

21-
- repo: https://github.com/pre-commit/mirrors-prettier
22-
rev: v3.0.3
23-
hooks:
24-
- id: prettier
25-
args: [--print-width=88, --tab-width=4]
26-
exclude: |
27-
(?x)(
28-
.github/semantic_release/release_notes.hbs
29-
)
3022
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
3123
rev: v2.11.0
3224
hooks:
3325
- id: pretty-format-toml
34-
args: [--autofix]
26+
args: [--autofix, --no-sort]
3527

3628
- repo: local
3729
hooks:
38-
- id: test
39-
name: test
40-
description: Runs Unit Tests
41-
entry: hatch run test
30+
- id: uv-lock
31+
name: uv-lock
32+
description: Runs uv lock when pyproject.toml changes
33+
entry: uv lock
4234
language: system
4335
pass_filenames: false
44-
require_serial: false
36+
files: pyproject.toml
37+
- id: prettier
38+
name: prettier
39+
description: Runs Prettier Code Formatter
40+
entry: prettier --write --ignore-unknown
41+
args: ["--tab-width=4"]
42+
language: node
43+
types:
44+
- text
45+
additional_dependencies:
46+

.releaserc.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,21 @@
1414
"prerelease": true
1515
}
1616
],
17-
"plugins": ["semantic-release-gitmoji", "@semantic-release/github"]
17+
"plugins": [
18+
"semantic-release-gitmoji",
19+
[
20+
"@semantic-release/exec",
21+
{
22+
"prepareCmd": "uv version ${nextRelease.version} && uv build"
23+
}
24+
],
25+
[
26+
"@semantic-release/git",
27+
{
28+
"assets": ["pyproject.toml", "uv.lock"],
29+
"message": "🔖 cookiecutter-python ${nextRelease.version}\n\n${nextRelease.notes}\n[skip ci]"
30+
}
31+
],
32+
"@semantic-release/github"
33+
]
1834
}

0 commit comments

Comments
 (0)