Skip to content

Commit 6320819

Browse files
committed
feat: test semantic release
1 parent 30ff13a commit 6320819

File tree

6 files changed

+76
-38
lines changed

6 files changed

+76
-38
lines changed

.github/update-requirements.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Update requirements
2+
on:
3+
push:
4+
paths:
5+
- 'scrapegraph-py/pyproject.toml'
6+
- '.github/workflows/update-requirements.yml'
7+
8+
jobs:
9+
update:
10+
name: Update requirements
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Install the latest version of rye
14+
uses: eifinger/setup-rye@v3
15+
- name: Build app
16+
run: rye run update-requirements
17+
commit:
18+
name: Commit changes
19+
run: |
20+
git config --global user.name 'github-actions'
21+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
22+
git add .
23+
git commit -m "ci: update requirements.txt [skip ci]"
24+
git push
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pylint.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,18 @@ on:
44
- 'scrapegraph-py/**'
55
- '.github/workflows/pylint.yml'
66

7-
permissions:
8-
contents: read
9-
pull-requests: write
10-
117
jobs:
128
build:
139
runs-on: ubuntu-latest
1410
steps:
15-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v3
1612
- name: Install the latest version of rye
1713
uses: eifinger/setup-rye@v3
1814
- name: Install dependencies
19-
run: |
20-
cd scrapegraph-py
21-
rye sync --no-lock
15+
run: rye sync --no-lock
2216
- name: Analysing the code with pylint
23-
working-directory: scrapegraph-py
2417
run: rye run pylint-ci
2518
- name: Check Pylint score
26-
working-directory: scrapegraph-py
2719
run: |
2820
pylint_score=$(rye run pylint-score-ci | grep 'Raw metrics' | awk '{print $4}')
2921
if (( $(echo "$pylint_score < 8" | bc -l) )); then

.github/workflows/python-publish.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@ on:
77
release:
88
types: [published]
99

10-
permissions:
11-
contents: read
12-
id-token: write
13-
1410
jobs:
1511
deploy:
1612

1713
runs-on: ubuntu-latest
1814

1915
steps:
20-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v3
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
2119
with:
22-
fetch-depth: 0
23-
- name: Install the latest version of rye
24-
uses: eifinger/setup-rye@v3
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
2525
- name: Build and publish
2626
env:
27-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
27+
TWINE_USERNAME: mvincig11
28+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2829
run: |
2930
git fetch --all --tags
30-
cd scrapegraph-py
31-
rye build
32-
rye publish --token "$PYPI_TOKEN"
31+
python setup.py sdist bdist_wheel
32+
twine upload dist/*

.github/workflows/release.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
id: build_cache
3434
if: success()
3535
- name: Cache build
36-
uses: actions/cache@v4
36+
uses: actions/cache@v2
3737
with:
38-
path: ./scrapegraph-py/dist
38+
path: scrapegraph-py/dist
3939
key: ${{ runner.os }}-build-${{ hashFiles('scrapegraph-py/dist/**') }}
4040
if: steps.build_cache.outputs.id != ''
4141

@@ -60,25 +60,18 @@ jobs:
6060
with:
6161
fetch-depth: 0
6262
persist-credentials: false
63-
- name: Setup Node.js
64-
uses: actions/setup-node@v4
65-
with:
66-
node-version: 20
67-
cache: 'npm'
68-
- name: Install dependencies
69-
run: npm install
7063
- name: Semantic Release
7164
uses: cycjimmy/[email protected]
7265
with:
7366
semantic_version: 23
7467
extra_plugins: |
7568
semantic-release-pypi@3
76-
@semantic-release/git@10
77-
@semantic-release/commit-analyzer@12
78-
@semantic-release/release-notes-generator@13
79-
@semantic-release/github@10
69+
@semantic-release/git
70+
@semantic-release/commit-analyzer@12
71+
@semantic-release/release-notes-generator@13
72+
@semantic-release/github@10
8073
@semantic-release/changelog@6
8174
conventional-changelog-conventionalcommits@7
8275
env:
8376
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
77+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

.releaserc.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
{
22
"branches": ["main", {"name": "pre/*", "prerelease": true}],
33
"plugins": [
4-
"@semantic-release/commit-analyzer",
5-
"@semantic-release/release-notes-generator",
4+
["@semantic-release/commit-analyzer", {
5+
"preset": "conventionalcommits",
6+
"releaseRules": [
7+
{"type": "docs", "scope": "README", "release": "patch"},
8+
{"type": "refactor", "release": "patch"},
9+
{"type": "style", "release": "patch"}
10+
]
11+
}],
12+
["@semantic-release/release-notes-generator", {
13+
"preset": "conventionalcommits",
14+
"presetConfig": {
15+
"types": [
16+
{"type": "feat", "section": "Features"},
17+
{"type": "fix", "section": "Bug Fixes"},
18+
{"type": "chore", "section": "Maintenance"},
19+
{"type": "docs", "section": "Documentation"},
20+
{"type": "style", "section": "Styling"},
21+
{"type": "refactor", "section": "Refactoring"},
22+
{"type": "perf", "section": "Performance"},
23+
{"type": "test", "section": "Testing"}
24+
]
25+
}
26+
}],
627
"@semantic-release/changelog",
728
["semantic-release-pypi", {
829
"path": "./scrapegraph-py"

CHANGELOG.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
All notable changes to the Scrapegraph SDK will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

0 commit comments

Comments
 (0)