Skip to content

Commit 6e7342f

Browse files
committed
github: Add workflows.
1 parent 388955c commit 6e7342f

File tree

3 files changed

+100
-2
lines changed

3 files changed

+100
-2
lines changed

.github/workflows/check-commits.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: '📜 Check Commit Messages'
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
branches:
11+
- 'main'
12+
13+
jobs:
14+
check-commit-messages:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: '📜 Check commit messages format'
18+
uses: gsactions/commit-message-checker@v1
19+
with:
20+
pattern: '^[^!]+: [A-Za-z]+.+ .+\.$'
21+
flags: 'gm'
22+
error: 'Commit subject line must match the following pattern: <scope>: <description>.'
23+
excludeTitle: 'false'
24+
excludeDescription: 'true'
25+
checkAllCommitMessages: 'true'
26+
accessToken: ${{ secrets.GITHUB_TOKEN }}
27+
- name: '📜 Check commit messages length'
28+
uses: gsactions/commit-message-checker@v1
29+
with:
30+
pattern: '^[^#].{10,78}$'
31+
error: 'Commit subject line maximum line length of 78 characters is exceeded.'
32+
excludeTitle: 'false'
33+
excludeDescription: 'true'
34+
checkAllCommitMessages: 'true'
35+
accessToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/python-linter.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@ jobs:
1919
python-version: ["3.8", "3.9", "3.10"]
2020

2121
steps:
22-
- uses: actions/checkout@v3
23-
- name: Set up Python ${{ matrix.python-version }}
22+
- name: '⏳ Checkout repository'
23+
uses: actions/checkout@v3
24+
25+
- name: '🐍 Set up Python ${{ matrix.python-version }}'
2426
uses: actions/setup-python@v3
2527
with:
2628
python-version: ${{ matrix.python-version }}
29+
2730
- name: '🛠 Install dependencies'
2831
run: |
2932
python -m pip install --upgrade pip
3033
python -m pip install flake8 pytest
3134
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
35+
3236
- name: '😾 Lint with flake8'
3337
run: |
3438
# stop the build if there are Python syntax errors or undefined names

.github/workflows/python-package.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: '📦 Python Package'
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*.*.*'
10+
branches:
11+
- "!*"
12+
paths:
13+
- '*.py'
14+
- '.github/workflows/*.yml'
15+
- '.github/workflows/*.json'
16+
- '!**/README.md'
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: write
26+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
27+
steps:
28+
- name: '⏳ Checkout repository'
29+
uses: actions/checkout@v3
30+
31+
- name: '🐍 Set up Python 3'
32+
uses: actions/setup-python@v3
33+
with:
34+
python-version: "3.10"
35+
36+
- name: '🛠 Install dependencies'
37+
run: |
38+
python -m pip install --upgrade pip
39+
python -m pip install build
40+
41+
- name: '📦 Build package'
42+
run: python3 -m build
43+
44+
- name: "✏️ Generate changelog"
45+
id: changelog
46+
uses: mikepenz/release-changelog-builder-action@v3
47+
with:
48+
toTag: ${{ github.sha }}
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: '🔥 Create release'
53+
uses: softprops/action-gh-release@v1
54+
with:
55+
draft: false
56+
files: dist/*
57+
body: ${{steps.changelog.outputs.changelog}}
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)