Skip to content

Commit 241acae

Browse files
committed
chore: initial commit
0 parents  commit 241acae

31 files changed

+2092
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/zproject/_version.py export-subst
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: 버그 수정
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**버그에 대해 설명해 주세요 :)**
10+
11+
[..] 할 때 [..] 에러가 나며 트레이닝이 멈춥니다.
12+
(GIF, 동영상 등 드래그해서 첨부할 수도 있습니다.)
13+
14+
**To Reproduce**
15+
16+
버그 만드는 법:
17+
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
23+
**Expected behavior**
24+
25+
원래대로라면 [...] 해야 합니다.
26+
27+
**로그 파일을 붙여넣어 주세요 :)**
28+
29+
<details>
30+
<code>
31+
32+
여기에 붙여넣어 주세요
33+
34+
</code>
35+
</details>
36+
37+
**사용하고 계시는 프로그램의 버전을 입력해 주세요 :)**
38+
39+
```
40+
여기에 적어주세요
41+
```
42+
43+
**기타 내용을 적어주세요 :)**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: 기능 추가 요청
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**겪고 계신 문제를 설명해 주세요 :)**
11+
[...] 할때 항상 [...] 문제가 있습니다.
12+
13+
**원하시는 솔루션을 설명해 주세요 :)**
14+
15+
**다른 대안을 고려해 보셨다면 설명해 주세요 :)**
16+
17+
**사용하고 계시는 프로그램의 버전을 적어주세요 :)**
18+
19+
**기타 내용을 적어주세요 :)**

.github/workflows/deploy.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
environment: mkdocs
12+
13+
steps:
14+
- name: Checkout to the branch of the tag
15+
run: |
16+
# checkout from GitHub CI without using actions/checkout
17+
git clone https://oauth2:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git .
18+
git fetch origin ${{ github.ref_name }}
19+
20+
# check if git tag is the last commit of some branch
21+
TAG=${{ github.ref_name }}
22+
git branch -a --contains $TAG
23+
BRANCH=$(git branch -a --contains $TAG | grep -v HEAD | head -n 1 | sed 's/^* //' | sed 's/^ //')
24+
echo "branch: $BRANCH"
25+
LAST_COMMIT=$(git rev-parse $BRANCH)
26+
echo "last commit hash: $LAST_COMMIT"
27+
TAG_COMMIT=$(git rev-list -n 1 $TAG)
28+
echo "tag commit hash: $TAG_COMMIT"
29+
30+
if [[ "$LAST_COMMIT" != "$TAG_COMMIT" ]]; then
31+
echo "ERROR: Tag $TAG is NOT the last commit of branch $BRANCH. Exiting.."
32+
exit 1
33+
fi
34+
35+
git checkout "$BRANCH"
36+
37+
- name: Update CHANGELOG
38+
id: changelog
39+
uses: requarks/changelog-action@v1
40+
with:
41+
includeInvalidCommits: true
42+
excludeTypes: build,docs,style
43+
token: ${{ github.token }}
44+
tag: ${{ github.ref_name }}
45+
46+
- name: Commit CHANGELOG.md
47+
run: |
48+
git config user.name github-actions
49+
git config user.email github-actions@github.com
50+
git tag -d ${{ github.ref_name }}
51+
git push origin --delete ${{ github.ref_name }}
52+
git add CHANGELOG.md
53+
git commit -m "docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]"
54+
git tag -a ${{ github.ref_name }} -m ${{ github.ref_name }}
55+
git push
56+
git push --tags
57+
58+
- name: Create Release
59+
uses: ncipollo/release-action@v1.12.0
60+
with:
61+
allowUpdates: true
62+
draft: false
63+
makeLatest: true
64+
name: ${{ github.ref_name }}
65+
body: ${{ steps.changelog.outputs.changes }}
66+
token: ${{ github.token }}
67+
68+
- name: Set up Python ${{ matrix.python-version }}
69+
uses: actions/setup-python@v4
70+
with:
71+
python-version: 3.11
72+
- name: Install dependencies
73+
run: |
74+
python -m pip install --upgrade pip
75+
pip3 install -r requirements_docs.txt
76+
- name: Run mkdocs
77+
run: |
78+
set +e # Do not exit shell on failure
79+
export GL_PROJECT=kiyoon/python-project-template-docs
80+
export HTTPS_REMOTE="https://gitlab-ci-token:${{ secrets.GL_TOKEN }}@gitlab.com/$GL_PROJECT.git"
81+
82+
git config user.name github-actions
83+
git config user.email github-actions@github.com
84+
git remote add gitlab "$HTTPS_REMOTE"
85+
git branch -D gl-pages
86+
git pull gitlab gl-pages:gl-pages
87+
88+
# Delete the latest page because we're going to make it as an alias to the latest version.
89+
mike delete --deploy-prefix public -r $HTTPS_REMOTE -b gl-pages latest
90+
out=$(mike deploy --deploy-prefix public -r $HTTPS_REMOTE -p -b gl-pages -u ${{ github.ref_name }} latest 2> stderr.txt)
91+
exit_code=$?
92+
err=$(<stderr.txt)
93+
94+
mike set-default --deploy-prefix public -r $HTTPS_REMOTE -p -b gl-pages latest
95+
96+
# Display the raw output in the step
97+
echo "${out}"
98+
echo "${err}"
99+
100+
# Display the Markdown output in the job summary
101+
echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY
102+
echo "${out}" >> $GITHUB_STEP_SUMMARY
103+
echo "${err}" >> $GITHUB_STEP_SUMMARY
104+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
105+
106+
exit ${exit_code}

.github/workflows/docs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
9+
jobs:
10+
mkdocs:
11+
runs-on: ubuntu-latest
12+
environment: mkdocs
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: 3.11
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip3 install -r requirements_docs.txt
24+
# pip3 install -e .
25+
- name: Run mkdocs
26+
run: |
27+
set +e # Do not exit shell on failure
28+
export GL_PROJECT=kiyoon/python-project-template-docs
29+
export HTTPS_REMOTE="https://gitlab-ci-token:${{ secrets.GL_TOKEN }}@gitlab.com/$GL_PROJECT.git"
30+
31+
git config user.name github-actions
32+
git config user.email github-actions@github.com
33+
git remote add gitlab "$HTTPS_REMOTE"
34+
git pull gitlab gl-pages:gl-pages
35+
36+
out=$(mike deploy --deploy-prefix public -r $HTTPS_REMOTE -p -b gl-pages -u latest 2> stderr.txt)
37+
exit_code=$?
38+
err=$(<stderr.txt)
39+
40+
mike set-default --deploy-prefix public -r $HTTPS_REMOTE -p -b gl-pages latest
41+
42+
# Display the raw output in the step
43+
echo "${out}"
44+
echo "${err}"
45+
46+
# Display the Markdown output in the job summary
47+
echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY
48+
echo "${out}" >> $GITHUB_STEP_SUMMARY
49+
echo "${err}" >> $GITHUB_STEP_SUMMARY
50+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
51+
52+
exit ${exit_code}

.github/workflows/lint.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Linting
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
ruff:
7+
name: ruff
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up Python 3.11
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: 3.11
15+
- name: Install ruff and requirements
16+
run: |
17+
pip3 install ruff==0.1.0
18+
- name: Run ruff
19+
run: |
20+
set +e # Do not exit shell on ruff failure
21+
22+
nonzero_exit=0
23+
files=$(find . -type f -name "*.py" | sort)
24+
while read file; do
25+
out=$(ruff check "$file" 2> ruff_stderr.txt)
26+
exit_code=$?
27+
err=$(<ruff_stderr.txt)
28+
29+
if [[ $exit_code -ne 0 ]]; then
30+
nonzero_exit=$exit_code
31+
fi
32+
33+
if [[ -n "$out" ]]; then
34+
# Display the raw output in the step
35+
echo "${out}"
36+
# Display the Markdown output in the job summary
37+
echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY
38+
echo "${out}" >> $GITHUB_STEP_SUMMARY
39+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
40+
fi
41+
if [[ -n "$err" ]]; then
42+
echo "${err}"
43+
echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY
44+
echo "${err}" >> $GITHUB_STEP_SUMMARY
45+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
46+
fi
47+
48+
out=$(ruff check --diff "$file" 2> ruff_stderr.txt)
49+
err=$(<ruff_stderr.txt)
50+
51+
if [[ -n "$out" ]]; then
52+
# Display the raw output in the step
53+
echo "${out}"
54+
# Display the Markdown output in the job summary
55+
echo "\`\`\`diff" >> $GITHUB_STEP_SUMMARY
56+
echo "${out}" >> $GITHUB_STEP_SUMMARY
57+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
58+
fi
59+
if [[ -n "$err" ]]; then
60+
echo "${err}"
61+
echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY
62+
echo "${err}" >> $GITHUB_STEP_SUMMARY
63+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
64+
fi
65+
done <<< "$files"
66+
67+
# Exit with the first non-zero exit-code returned by ruff
68+
# or just zero if all passed
69+
exit ${nonzero_exit}

0 commit comments

Comments
 (0)