Skip to content

Commit 30ff13a

Browse files
committed
feat: semantic relaase
1 parent 97d9977 commit 30ff13a

File tree

8 files changed

+187
-22
lines changed

8 files changed

+187
-22
lines changed

.github/workflows/codeql.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '42 19 * * 5'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners
29+
# Consider using larger runners for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
32+
permissions:
33+
# required for all workflows
34+
security-events: write
35+
36+
# only required for workflows in private repositories
37+
actions: read
38+
contents: read
39+
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
language: [ 'python' ]
44+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
45+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
46+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
47+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
48+
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
53+
# Initializes the CodeQL tools for scanning.
54+
- name: Initialize CodeQL
55+
uses: github/codeql-action/init@v3
56+
with:
57+
languages: ${{ matrix.language }}
58+
# If you wish to specify custom queries, you can do so here or in a config file.
59+
# By default, queries listed here will override any specified in a config file.
60+
# Prefix the list here with "+" to use these queries and those in the config file.
61+
62+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
63+
# queries: security-extended,security-and-quality
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable
6+
# packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
10+
name: 'Dependency review'
11+
on:
12+
pull_request:
13+
branches: [ "main" ]
14+
15+
# If using a dependency submission action in this workflow this permission will need to be set to:
16+
#
17+
# permissions:
18+
# contents: write
19+
#
20+
# https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api
21+
permissions:
22+
contents: read
23+
# Write permissions for pull-requests are required for using the `comment-summary-in-pr` option, comment out if you aren't using this option
24+
pull-requests: write
25+
26+
jobs:
27+
dependency-review:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: 'Checkout repository'
31+
uses: actions/checkout@v4
32+
- name: 'Dependency Review'
33+
uses: actions/dependency-review-action@v4
34+
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
35+
with:
36+
comment-summary-in-pr: always
37+
# fail-on-severity: moderate
38+
# deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later
39+
# retry-on-snapshot-warnings: true

.github/workflows/pylint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
push:
3+
paths:
4+
- 'scrapegraph-py/**'
5+
- '.github/workflows/pylint.yml'
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Install the latest version of rye
17+
uses: eifinger/setup-rye@v3
18+
- name: Install dependencies
19+
run: |
20+
cd scrapegraph-py
21+
rye sync --no-lock
22+
- name: Analysing the code with pylint
23+
working-directory: scrapegraph-py
24+
run: rye run pylint-ci
25+
- name: Check Pylint score
26+
working-directory: scrapegraph-py
27+
run: |
28+
pylint_score=$(rye run pylint-score-ci | grep 'Raw metrics' | awk '{print $4}')
29+
if (( $(echo "$pylint_score < 8" | bc -l) )); then
30+
echo "Pylint score is below 8. Blocking commit."
31+
exit 1
32+
else
33+
echo "Pylint score is acceptable."
34+
fi

.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+
1014
jobs:
1115
deploy:
1216

1317
runs-on: ubuntu-latest
1418

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

.github/workflows/release.yml

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

4242
release:
@@ -60,16 +60,23 @@ 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
6370
- name: Semantic Release
6471
uses: cycjimmy/[email protected]
6572
with:
6673
semantic_version: 23
6774
extra_plugins: |
6875
semantic-release-pypi@3
69-
@semantic-release/git
70-
@semantic-release/commit-analyzer@12
71-
@semantic-release/release-notes-generator@13
72-
@semantic-release/github@10
76+
@semantic-release/git@10
77+
@semantic-release/commit-analyzer@12
78+
@semantic-release/release-notes-generator@13
79+
@semantic-release/github@10
7380
@semantic-release/changelog@6
7481
conventional-changelog-conventionalcommits@7
7582
env:

.releaserc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"branches": ["main", {"name": "pre/*", "prerelease": true}],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
["semantic-release-pypi", {
8+
"path": "./scrapegraph-py"
9+
}],
10+
["@semantic-release/git", {
11+
"assets": [
12+
"scrapegraph-py/pyproject.toml",
13+
"CHANGELOG.md"
14+
],
15+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
16+
}],
17+
"@semantic-release/github"
18+
]
19+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
"semantic-release": "semantic-release"
1717
},
1818
"devDependencies": {
19+
"@semantic-release/changelog": "^6.0.0",
20+
"@semantic-release/git": "^10.0.0",
1921
"@semantic-release/github": "^9.2.6",
2022
"@semantic-release/npm": "^11.0.2",
21-
"semantic-release": "^23.0.0"
23+
"semantic-release": "^23.0.0",
24+
"semantic-release-pypi": "^3.0.0"
2225
}
2326
}

scrapegraph-py/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ dependencies = [
1717
license = "MIT"
1818
readme = "README.md"
1919
homepage = "https://scrapegraphai.com/"
20-
repository = ""
21-
documentation = ""
20+
repository = "https://github.com/ScrapeGraphAI/scrapegraph-sdk"
21+
documentation = "https://github.com/ScrapeGraphAI/scrapegraph-sdk/tree/main/scrapegraph-py#readme"
2222
keywords = [
2323
"ai",
2424
"artificial intelligence",

0 commit comments

Comments
 (0)