Skip to content

Commit f37d7e1

Browse files
committed
chore(standardize the commit process; create github release): github release; husky+commitlint
create github release if not exist; standardize the commit process using husky and commitline
1 parent dee8b38 commit f37d7e1

7 files changed

Lines changed: 4082 additions & 12 deletions

File tree

.github/workflows/Dockerfile

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

.github/workflows/docker.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
- pypi_test
7+
- actions
88

99
jobs:
1010
publish_package:
@@ -45,3 +45,21 @@ jobs:
4545
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
4646
run: |
4747
python -m twine upload dist/*
48+
49+
- name: Check if GitHub Release exists
50+
id: check-release
51+
env:
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
run: |
54+
TAG="v${{ steps.version.outputs.version }}"
55+
gh release view "$TAG" > /dev/null 2>&1 && echo "exists=yes" || echo "exists=no"
56+
echo "exists=$?" >> "$GITHUB_OUTPUT"
57+
58+
- name: Create GitHub Release
59+
if: steps.check-release.outputs.exists == 'no'
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
run: |
63+
gh release create v${{ steps.version.outputs.version }} dist/* \
64+
--title "Release v${{ steps.version.outputs.version }}" \
65+
--notes "Automated release from GitHub Actions"

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,17 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
# Node.js
132+
node_modules/
133+
134+
# VSCode
135+
.vscode/
136+
137+
# Logs
138+
npm-debug.log*
139+
yarn-debug.log*
140+
yarn-error.log*
141+
142+
# Husky
143+
.husky/_/

.husky/commit-msg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
npx --no -- commitlint --edit "$1"

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

0 commit comments

Comments
 (0)