Skip to content

Commit 7a483f5

Browse files
feat: update github action,and update config
1 parent b591503 commit 7a483f5

File tree

5 files changed

+71
-17
lines changed

5 files changed

+71
-17
lines changed

.github/workflows/build.yaml renamed to .github/workflows/release-build.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ jobs:
1717
with:
1818
poetry-version: "latest"
1919

20-
- name: install-poetry-plugins
20+
- name: setup-pypi
2121
run: |
22+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
2223
poetry self add poetry-pyinstaller-plugin
2324
poetry self add poetry-plugin-taskipy
2425
2526
- name: build
26-
run: poetry build
27+
run: poetry publish --build
2728

2829
- name: Release
2930
uses: softprops/action-gh-release@v2
@@ -34,4 +35,4 @@ jobs:
3435
dist/*.whl
3536
generate_release_notes: true
3637
env:
37-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

template-python/cookiecutter.json

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,8 @@
44
"email": "[email protected]",
55
"project_slug": "{{ cookiecutter.repo_name.strip().lower().replace('-', '_') }}",
66
"description": "A short description of the project.",
7-
"include_cli": {
8-
"__prompt__": "Include CLI interface? (y/n)",
9-
"__choices__": [
10-
"y",
11-
"n"
12-
]
13-
},
14-
"create_github_repo": {
15-
"__prompt__": "Create GitHub repo? Requires ~/.github/config.json with GitHub token (y/n)",
16-
"__choices__": [
17-
"y",
18-
"n"
19-
]
20-
}
7+
"include_cli": [
8+
"y",
9+
"n"
10+
]
2111
}

template-python/hooks/post_gen_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import subprocess
3+
from githubkit import GitHub
34

45

56
def remove_cli():
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Bump version
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
bump-version:
11+
if: "!startsWith(github.event.head_commit.message, 'bump:')"
12+
runs-on: ubuntu-latest
13+
name: "Bump version and create changelog with commitizen"
14+
steps:
15+
- name: Check out
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
token: '${{ secrets.GITHUB_TOKEN }}'
20+
- name: Create bump and changelog
21+
uses: commitizen-tools/commitizen-action@master
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
branch: master
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: release-build
2+
on:
3+
push:
4+
tags:
5+
- '*.*.*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
release-build:
10+
runs-on: windows-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.12"
16+
- uses: abatilo/actions-poetry@v2
17+
with:
18+
poetry-version: "latest"
19+
20+
- name: setup-pypi
21+
run: |
22+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
23+
poetry self add poetry-pyinstaller-plugin
24+
poetry self add poetry-plugin-taskipy
25+
26+
- name: build
27+
run: poetry publish --build
28+
29+
- name: Release
30+
uses: softprops/action-gh-release@v2
31+
with:
32+
files: |
33+
dist/**/*.exe
34+
dist/*.tar.gz
35+
dist/*.whl
36+
generate_release_notes: true
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)