Skip to content

Commit c0e747e

Browse files
authored
Merge pull request #66 from mivek/ci/conventional-commits
ci: implement conventional commits
2 parents 7bc2580 + 27ec929 commit c0e747e

12 files changed

Lines changed: 7565 additions & 100 deletions

.github/workflows/github_release.yml

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

.github/workflows/lint-pr.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Lint PR"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
- reopened
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
main:
16+
name: Validate PR title
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@v5.5.3
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/main.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
87

98
jobs:
109
build:
1110

1211
runs-on: ubuntu-latest
1312
strategy:
1413
matrix:
15-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
14+
python-version: ['3.8', '3.9', '3.10', '3.11']
1615

1716
steps:
1817
- uses: actions/checkout@v4
@@ -36,10 +35,3 @@ jobs:
3635
- name: Test with unittest and generates reports
3736
run: |
3837
make report
39-
40-
- name: Upload coverage results
41-
uses: actions/upload-artifact@v3
42-
with:
43-
name: coverage.xml
44-
path: ./coverage.xml
45-
if: ${{ always() }}

.github/workflows/release.yml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
1+
name: Release
2+
13
on:
24
push:
3-
# Sequence of patterns matched against refs/tags
4-
tags:
5-
- '\d+\.\d+\.\d+'
5+
branches:
6+
- main
67

7-
name: Publish to Pypi
8+
permissions:
9+
contents: read
810

911
jobs:
10-
deploy:
11-
name: Deploy to PYPI
12+
release:
13+
name: Release
1214
runs-on: ubuntu-latest
13-
environment:
14-
name: release
15-
url: https://pypi.org/p/metar-taf-parser-mivek/
1615
permissions:
16+
contents: write
17+
issues: write
18+
pull-requests: write
1719
id-token: write
1820
steps:
1921
- uses: actions/checkout@v4
20-
21-
- name: Set up Python
22+
with:
23+
fetch-depth: 0
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 'lts/*'
28+
cache: 'npm'
29+
- name: Setup Python
2230
uses: actions/setup-python@v5
2331
with:
2432
python-version: '3.11'
25-
2633
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
make install_deploy
30-
31-
- name: Build the archives
32-
run: |
33-
python -m build --sdist --wheel --outdir dist/
34-
35-
- name: Publish to PyPI
36-
uses: pypa/gh-action-pypi-publish@release/v1
34+
run: npm install
35+
- name: Run semantic-release
36+
run: npx semantic-release
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint commit
2+
3+
on: pull_request
4+
5+
jobs:
6+
commitlint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 0
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 'lts/*'
15+
cache: npm
16+
17+
- name: Install commitlint
18+
run: |
19+
npm install conventional-changelog-conventionalcommits
20+
npm install commitlint@latest
21+
22+
- name: Validate PR commits with commitlint
23+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

.releaserc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"release": {
3+
"branches": ["main"],
4+
"plugins": [
5+
"@semantic-release/commit-analyzer",
6+
"@semantic-release/release-notes-generator",
7+
"@semantic-release/git",
8+
[
9+
"@semantic-release/changelog",
10+
{
11+
"changelogFile": "CHANGELOG.md"
12+
}
13+
],
14+
"@semantic-release-pypi",
15+
"@semantic-release/github",
16+
]
17+
}
18+
}

CONTRIBUTING.md

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,87 @@
1-
**Internationalization**
1+
## Pull Request Naming Guidelines
2+
3+
To keep the repository organized and to make it easier to understand the purpose of each pull request, the project follows these pull request naming conventions:
4+
5+
### Format
6+
7+
Each pull request name should include a type and a short description:
8+
9+
`<type>: <short-description></type>`
10+
11+
### Types
12+
13+
Use one of the following types:
14+
15+
- **feat**: A new feature
16+
- **fix**: A bug fix
17+
- **docs**: Documentation only changes
18+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
19+
- **refactor**: A code change that neither fixes a bug nor adds a feature
20+
- **perf**: A code change that improves performance
21+
- **test**: Adding missing or correcting existing tests
22+
- **build**: Changes that affect the build system or external dependencies
23+
- **ci**: Changes to the CI configuration files and scripts
24+
- **chore**: Other changes that don't modify src or test files
25+
- **revert**: Reverts a previous commit
26+
27+
### Examples
28+
29+
- `feat: add login feature`
30+
- `fix: bug in authentication`
31+
- `docs: update readme`
32+
- `chore: cleanup dependencies`
33+
- `refactor: improve parser`
34+
35+
By following these guidelines, you help ensure that the branches are easy to understand and manage.
36+
37+
## Commit Message Guidelines
38+
39+
This project follows the commit message conventions set by [Conventional Commits](https://www.conventionalcommits.org/).
40+
41+
### Commit Message Format
42+
43+
Each commit message should include a type, a scope (optional), and a subject:
44+
45+
`<type>(<scope>): <subject></subject></scope></type>`
46+
47+
#### Type
48+
49+
Must be one of the following:
50+
51+
- **feat**: A new feature
52+
- **fix**: A bug fix
53+
- **docs**: Documentation only changes
54+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
55+
- **refactor**: A code change that neither fixes a bug nor adds a feature
56+
- **perf**: A code change that improves performance
57+
- **test**: Adding missing or correcting existing tests
58+
- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
59+
- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
60+
- **chore**: Other changes that don't modify src or test files
61+
- **revert**: Reverts a previous commit
62+
63+
#### Subject
64+
65+
The subject contains a succinct description of the change:
66+
67+
- Use the imperative, present tense: "change" not "changed" nor "changes"
68+
- Do not capitalize the first letter
69+
- Do not end the subject with a period
70+
71+
### Examples
72+
73+
```plaintext
74+
feat(parser): add support for new weather condition
75+
76+
fix(translation): correct French translation for 'clear sky'
77+
78+
docs(contributing): add commit message guidelines
79+
```
80+
81+
By following these guidelines, you help ensure that the project remains consistent and easy to understand.
82+
83+
84+
## Internationalization
285

386
If you are willing to add a new language or complete an existing language, please use https://crwd.in/metarParser to register and contribute.
487
Once a language is complete at 100%, open an issue so the translation can be added to the project.

commitlint.config.js

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

0 commit comments

Comments
 (0)