splunk-soar-sdk 1.0.0b3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- splunk_soar_sdk-1.0.0b3/.github/utils/github.js +89 -0
- splunk_soar_sdk-1.0.0b3/.github/utils/update_version.py +47 -0
- splunk_soar_sdk-1.0.0b3/.github/workflows/code_quality.yml +62 -0
- splunk_soar_sdk-1.0.0b3/.github/workflows/commit_hygiene.yml +53 -0
- splunk_soar_sdk-1.0.0b3/.github/workflows/semantic_release.yml +54 -0
- splunk_soar_sdk-1.0.0b3/.gitignore +109 -0
- splunk_soar_sdk-1.0.0b3/.pre-commit-config.yaml +45 -0
- splunk_soar_sdk-1.0.0b3/.releaserc +37 -0
- splunk_soar_sdk-1.0.0b3/LICENSE +201 -0
- splunk_soar_sdk-1.0.0b3/PKG-INFO +52 -0
- splunk_soar_sdk-1.0.0b3/README.md +21 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/.pre-commit-config.yml +11 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/logo.svg +7 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/logo_dark.svg +7 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/pyproject.toml +38 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/src/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/src/app.py +18 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/tests/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/tests/test_app.py +13 -0
- splunk_soar_sdk-1.0.0b3/app_templates/basic_app/uv.lock +478 -0
- splunk_soar_sdk-1.0.0b3/commitlint.config.js +1 -0
- splunk_soar_sdk-1.0.0b3/docs/actions/action_anatomy.md +101 -0
- splunk_soar_sdk-1.0.0b3/docs/actions/action_decorator.md +105 -0
- splunk_soar_sdk-1.0.0b3/docs/actions/action_definition.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/actions/action_outputs.md +106 -0
- splunk_soar_sdk-1.0.0b3/docs/actions/action_params.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/actions/action_results.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/actions/index.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/advanced_usage.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/app_configuration.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/app_manifest.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/app_structure/app.py.md +113 -0
- splunk_soar_sdk-1.0.0b3/docs/app_structure/index.md +9 -0
- splunk_soar_sdk-1.0.0b3/docs/app_structure/pre-commit-config.yml.md +12 -0
- splunk_soar_sdk-1.0.0b3/docs/app_structure/pyproject.toml.md +105 -0
- splunk_soar_sdk-1.0.0b3/docs/app_structure/test_app.py.md +57 -0
- splunk_soar_sdk-1.0.0b3/docs/cicd_tools.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/getting_started.md +300 -0
- splunk_soar_sdk-1.0.0b3/docs/testing/actions.md +0 -0
- splunk_soar_sdk-1.0.0b3/docs/testing/index.md +0 -0
- splunk_soar_sdk-1.0.0b3/pyproject.toml +212 -0
- splunk_soar_sdk-1.0.0b3/release_notes.txt +33 -0
- splunk_soar_sdk-1.0.0b3/release_version.txt +1 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/__init__.py +3 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/abstract.py +74 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/action_results.py +89 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/actions_provider.py +66 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/adapters.py +58 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/api_callers.py +162 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/app.py +338 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/app_cli_runner.py +114 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/asset.py +116 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/cli.py +24 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/manifests/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/manifests/cli.py +21 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/manifests/processors.py +87 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/manifests/serializers.py +48 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/package/cli.py +206 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/package/utils.py +46 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/cli/path_utils.py +34 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/connector.py +104 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/input_spec.py +129 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/meta/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/meta/actions.py +27 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/meta/adapters.py +22 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/meta/app.py +32 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/meta/datatypes.py +8 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/meta/dependencies.py +285 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/params.py +134 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/py.typed +0 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/shims/phantom/action_result.py +39 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/shims/phantom/app.py +15 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/shims/phantom/base_connector.py +85 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/shims/phantom/install_info.py +17 -0
- splunk_soar_sdk-1.0.0b3/src/soar_sdk/types.py +16 -0
- splunk_soar_sdk-1.0.0b3/tests/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/tests/cli/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/tests/cli/manifests/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/tests/cli/manifests/test_processors.py +61 -0
- splunk_soar_sdk-1.0.0b3/tests/cli/test_cli.py +59 -0
- splunk_soar_sdk-1.0.0b3/tests/cli/test_manifests_cli.py +91 -0
- splunk_soar_sdk-1.0.0b3/tests/cli/test_package_cli.py +146 -0
- splunk_soar_sdk-1.0.0b3/tests/cli/test_serializers.py +252 -0
- splunk_soar_sdk-1.0.0b3/tests/conftest.py +164 -0
- splunk_soar_sdk-1.0.0b3/tests/example_app/app.json +271 -0
- splunk_soar_sdk-1.0.0b3/tests/example_app/logo.svg +7 -0
- splunk_soar_sdk-1.0.0b3/tests/example_app/logo_dark.svg +7 -0
- splunk_soar_sdk-1.0.0b3/tests/example_app/pyproject.toml +65 -0
- splunk_soar_sdk-1.0.0b3/tests/example_app/src/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/tests/example_app/src/app.py +46 -0
- splunk_soar_sdk-1.0.0b3/tests/example_app/uv.lock +1031 -0
- splunk_soar_sdk-1.0.0b3/tests/meta/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/tests/meta/test_adapters.py +8 -0
- splunk_soar_sdk-1.0.0b3/tests/meta/test_dependencies.py +175 -0
- splunk_soar_sdk-1.0.0b3/tests/mocks/__init__.py +0 -0
- splunk_soar_sdk-1.0.0b3/tests/mocks/dynamic_mocks.py +9 -0
- splunk_soar_sdk-1.0.0b3/tests/stubs.py +43 -0
- splunk_soar_sdk-1.0.0b3/tests/test_action_results.py +78 -0
- splunk_soar_sdk-1.0.0b3/tests/test_actions_provider.py +168 -0
- splunk_soar_sdk-1.0.0b3/tests/test_adapters.py +23 -0
- splunk_soar_sdk-1.0.0b3/tests/test_app.py +44 -0
- splunk_soar_sdk-1.0.0b3/tests/test_app_action.py +241 -0
- splunk_soar_sdk-1.0.0b3/tests/test_app_action_params.py +56 -0
- splunk_soar_sdk-1.0.0b3/tests/test_app_action_results.py +77 -0
- splunk_soar_sdk-1.0.0b3/tests/test_app_runner.py +226 -0
- splunk_soar_sdk-1.0.0b3/tests/test_asset.py +71 -0
- splunk_soar_sdk-1.0.0b3/tests/test_connector.py +129 -0
- splunk_soar_sdk-1.0.0b3/tests/test_params.py +21 -0
- splunk_soar_sdk-1.0.0b3/tests/test_test_connectivity.py +86 -0
- splunk_soar_sdk-1.0.0b3/uv.lock +1188 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
async function getReleaseVersion() {
|
|
4
|
+
try {
|
|
5
|
+
return (await readFile("release_version.txt")).toString().trim();
|
|
6
|
+
} catch (err) {
|
|
7
|
+
if (err.code === "ENOENT") {
|
|
8
|
+
// File does not exist
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
throw err;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async function uploadReleaseArtifacts({ github, context }) {
|
|
16
|
+
const tag = await getReleaseVersion();
|
|
17
|
+
if (!tag) {
|
|
18
|
+
console.log("This change did not result in a release.");
|
|
19
|
+
return
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const { owner, repo } = context.repo;
|
|
23
|
+
|
|
24
|
+
const files = await readdir("dist");
|
|
25
|
+
const artifacts = files.filter((f) => f.endsWith(".whl") || f.endsWith(".tar.gz"));
|
|
26
|
+
|
|
27
|
+
const getRelease = await github.rest.repos.getReleaseByTag({
|
|
28
|
+
owner,
|
|
29
|
+
repo,
|
|
30
|
+
tag,
|
|
31
|
+
});
|
|
32
|
+
const release_id = getRelease.data.id;
|
|
33
|
+
|
|
34
|
+
for await (const name of artifacts) {
|
|
35
|
+
const data = await readFile(`dist/${name}`);
|
|
36
|
+
await github.rest.repos.uploadReleaseAsset({
|
|
37
|
+
owner,
|
|
38
|
+
repo,
|
|
39
|
+
release_id,
|
|
40
|
+
name,
|
|
41
|
+
data,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function commentReleaseNotes({ github, context }) {
|
|
47
|
+
let commentBody = "Merging this PR will not result in a release.";
|
|
48
|
+
|
|
49
|
+
const versionNumber = await getReleaseVersion();
|
|
50
|
+
if (versionNumber) {
|
|
51
|
+
const releaseNotes = (await readFile("release_notes.txt")).toString().trim();
|
|
52
|
+
commentBody = `Merging this PR will release \`${versionNumber}\` with the following release notes:\n\n${releaseNotes}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Add an invisible breadcrumb to the comment body so we can find it later
|
|
56
|
+
const bodyBreadcrumb = "<!-- semantic-release-breadcrumb -->\n";
|
|
57
|
+
const issueContext = {
|
|
58
|
+
issue_number: context.issue.number,
|
|
59
|
+
owner: context.repo.owner,
|
|
60
|
+
repo: context.repo.repo,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const comment = {
|
|
64
|
+
...issueContext,
|
|
65
|
+
body: `${bodyBreadcrumb}${commentBody}`,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
for await (const { data } of github.paginate.iterator(
|
|
69
|
+
github.rest.issues.listComments, issueContext
|
|
70
|
+
)) {
|
|
71
|
+
for (const {id, body} of data) {
|
|
72
|
+
if (body.startsWith(bodyBreadcrumb)) {
|
|
73
|
+
console.log(`Updating comment ${id}`);
|
|
74
|
+
await github.rest.issues.updateComment({
|
|
75
|
+
comment_id: id,
|
|
76
|
+
...comment,
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Pre-condition: we haven't already commented on this PR
|
|
84
|
+
console.log("Creating comment");
|
|
85
|
+
await github.rest.issues.createComment(comment);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { uploadReleaseArtifacts, commentReleaseNotes };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from tomlkit import parse, dumps
|
|
4
|
+
from tomlkit.container import Container
|
|
5
|
+
|
|
6
|
+
from typing import cast
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def update_version(version: str) -> None:
|
|
10
|
+
pyproject_path = "pyproject.toml"
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
# Read the pyproject.toml file
|
|
14
|
+
with open(pyproject_path) as file:
|
|
15
|
+
pyproject_content = file.read()
|
|
16
|
+
|
|
17
|
+
# Parse the TOML content
|
|
18
|
+
pyproject_data = parse(pyproject_content)
|
|
19
|
+
|
|
20
|
+
# Update the version in the "project" table
|
|
21
|
+
project_table = cast(Container, pyproject_data["project"])
|
|
22
|
+
project_table["version"] = version
|
|
23
|
+
|
|
24
|
+
# Write the updated content back to the file
|
|
25
|
+
with open(pyproject_path, "w") as file:
|
|
26
|
+
file.write(dumps(pyproject_data))
|
|
27
|
+
|
|
28
|
+
print(f"Version updated to {version} in pyproject.toml")
|
|
29
|
+
|
|
30
|
+
except FileNotFoundError:
|
|
31
|
+
print(f"Error: {pyproject_path} not found")
|
|
32
|
+
except Exception as e:
|
|
33
|
+
print(f"An error occurred: {e}")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def parse_args() -> argparse.Namespace:
|
|
37
|
+
"""Parse command line arguments."""
|
|
38
|
+
parser = argparse.ArgumentParser(description="Update the version in pyproject.toml")
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
"version", type=str, help="New version to set in pyproject.toml"
|
|
41
|
+
)
|
|
42
|
+
return parser.parse_args()
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
if __name__ == "__main__":
|
|
46
|
+
args = parse_args()
|
|
47
|
+
update_version(args.version)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: PR Checks
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
- beta
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
- beta
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
Precommit:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout code
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: 3.13
|
|
22
|
+
- name: Install pre-commit
|
|
23
|
+
run: uv tool install pre-commit --with pre-commit-uv
|
|
24
|
+
- name: Run pre-commit
|
|
25
|
+
run: pre-commit run --all-files --show-diff-on-failure
|
|
26
|
+
- name: Cache pre-commit
|
|
27
|
+
uses: actions/cache@v4
|
|
28
|
+
with:
|
|
29
|
+
path: ~/.cache/pre-commit
|
|
30
|
+
key: ${{ runner.os }}-pre-commit-cache
|
|
31
|
+
|
|
32
|
+
MyPy:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
strategy:
|
|
35
|
+
matrix:
|
|
36
|
+
python-version: [3.9, 3.13]
|
|
37
|
+
steps:
|
|
38
|
+
- name: Checkout code
|
|
39
|
+
uses: actions/checkout@v4
|
|
40
|
+
- name: Install uv
|
|
41
|
+
uses: astral-sh/setup-uv@v5
|
|
42
|
+
with:
|
|
43
|
+
enable-cache: true
|
|
44
|
+
python-version: ${{ matrix.python-version }}
|
|
45
|
+
- name: MyPy - ${{ matrix.python-version }}
|
|
46
|
+
run: uv run --locked mypy .
|
|
47
|
+
|
|
48
|
+
Pytest:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
strategy:
|
|
51
|
+
matrix:
|
|
52
|
+
python-version: [3.9, 3.13]
|
|
53
|
+
steps:
|
|
54
|
+
- name: Checkout code
|
|
55
|
+
uses: actions/checkout@v4
|
|
56
|
+
- name: Install uv
|
|
57
|
+
uses: astral-sh/setup-uv@v5
|
|
58
|
+
with:
|
|
59
|
+
enable-cache: true
|
|
60
|
+
python-version: ${{ matrix.python-version }}
|
|
61
|
+
- name: Pytest + Coverage - ${{ matrix.python-version }}
|
|
62
|
+
run: uv run --locked pytest
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Commit Hygiene
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
- beta
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
commitlint:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout code
|
|
13
|
+
uses: actions/checkout@v4
|
|
14
|
+
with:
|
|
15
|
+
fetch-depth: 0
|
|
16
|
+
- name: Set up NodeJS
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: "lts/*"
|
|
20
|
+
- name: Install commitlint
|
|
21
|
+
run: npm i -g @commitlint/cli @commitlint/config-conventional
|
|
22
|
+
- name: Commitlint
|
|
23
|
+
run: commitlint --from "origin/${{ github.base_ref }}" --to "origin/${{ github.head_ref }}"
|
|
24
|
+
|
|
25
|
+
semantic_release_dryrun:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout code
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
- name: Set up NodeJS
|
|
31
|
+
uses: actions/setup-node@v4
|
|
32
|
+
with:
|
|
33
|
+
node-version: "lts/*"
|
|
34
|
+
- name: Install semantic-release dependencies
|
|
35
|
+
run: npm install --global semantic-release @semantic-release/exec @semantic-release/git
|
|
36
|
+
- name: Check out the target branch and merge onto it
|
|
37
|
+
run: |
|
|
38
|
+
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
|
|
39
|
+
git fetch origin ${{ github.head_ref }}:${{ github.head_ref }}
|
|
40
|
+
git checkout ${{ github.base_ref }}
|
|
41
|
+
git merge --ff-only ${{ github.head_ref }}
|
|
42
|
+
- name: Run Semantic Release as a dry run
|
|
43
|
+
env:
|
|
44
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
45
|
+
run: |
|
|
46
|
+
unset GITHUB_ACTIONS GITHUB_REF GITHUB_EVENT_NAME
|
|
47
|
+
semantic-release --dry-run --no-ci
|
|
48
|
+
- name: Comment release notes on the PR
|
|
49
|
+
uses: actions/github-script@v7
|
|
50
|
+
with:
|
|
51
|
+
script: |
|
|
52
|
+
const { commentReleaseNotes } = await import('${{ github.workspace }}/.github/utils/github.js');
|
|
53
|
+
await commentReleaseNotes({github, context, core});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Run Semantic Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
- beta
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
semantic_release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment:
|
|
12
|
+
name: pypi
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write # Required for semantic-release to create release tags
|
|
15
|
+
pull-requests: write # Required for semantic-release to comment on PRs in release
|
|
16
|
+
id-token: write # Required for trusted publishing
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/create-github-app-token@v1
|
|
19
|
+
id: app-token
|
|
20
|
+
with:
|
|
21
|
+
app-id: ${{ vars.SEMANTIC_RELEASE_APP_ID }}
|
|
22
|
+
private-key: ${{ secrets.SEMANTIC_RELEASE_PRIVATE_KEY }}
|
|
23
|
+
- name: Checkout code
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 0
|
|
27
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
28
|
+
- name: Set up NodeJS
|
|
29
|
+
uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: "lts/*"
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@v5
|
|
34
|
+
with:
|
|
35
|
+
python-version: 3.13
|
|
36
|
+
- name: Install semantic-release dependencies
|
|
37
|
+
run: npm install --global semantic-release @semantic-release/exec @semantic-release/git
|
|
38
|
+
- name: Run Semantic Release
|
|
39
|
+
env:
|
|
40
|
+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
41
|
+
run: semantic-release
|
|
42
|
+
- name: Check out the newly-created tag
|
|
43
|
+
run: git fetch --tags && git checkout "$(cat release_version.txt)"
|
|
44
|
+
- name: Build package
|
|
45
|
+
run: uv build
|
|
46
|
+
- name: Publish to PyPI
|
|
47
|
+
run: uv publish
|
|
48
|
+
- name: Find the GitHub release and upload the artifacts to it
|
|
49
|
+
uses: actions/github-script@v7
|
|
50
|
+
with:
|
|
51
|
+
script: |
|
|
52
|
+
const { uploadReleaseArtifacts } = await import('${{ github.workspace }}/.github/utils/github.js');
|
|
53
|
+
uploadReleaseArtifacts({github, context, core});
|
|
54
|
+
github-token: ${{ steps.app-token.outputs.token }}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
.DS_Store
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# Installer logs
|
|
32
|
+
pip-log.txt
|
|
33
|
+
pip-delete-this-directory.txt
|
|
34
|
+
|
|
35
|
+
# Unit test / coverage reports
|
|
36
|
+
htmlcov/
|
|
37
|
+
.tox/
|
|
38
|
+
.nox/
|
|
39
|
+
.coverage
|
|
40
|
+
.coverage.*
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
*.cover
|
|
45
|
+
*.py,cover
|
|
46
|
+
.hypothesis/
|
|
47
|
+
.pytest_cache/
|
|
48
|
+
cover/
|
|
49
|
+
juniy.xml
|
|
50
|
+
|
|
51
|
+
# Translations
|
|
52
|
+
*.mo
|
|
53
|
+
*.po
|
|
54
|
+
|
|
55
|
+
# Django stuff:
|
|
56
|
+
*.log
|
|
57
|
+
local_settings.py
|
|
58
|
+
db.sqlite3
|
|
59
|
+
db.sqlite3-journal
|
|
60
|
+
|
|
61
|
+
# Flask stuff:
|
|
62
|
+
instance/
|
|
63
|
+
.webassets-cache
|
|
64
|
+
|
|
65
|
+
# Scrapy stuff:
|
|
66
|
+
.scrapy
|
|
67
|
+
|
|
68
|
+
# Sphinx documentation
|
|
69
|
+
docs/_build/
|
|
70
|
+
|
|
71
|
+
# PyBuilder
|
|
72
|
+
.pybuilder/
|
|
73
|
+
target/
|
|
74
|
+
|
|
75
|
+
# Jupyter Notebook
|
|
76
|
+
.ipynb_checkpoints
|
|
77
|
+
|
|
78
|
+
# IPython
|
|
79
|
+
profile_default/
|
|
80
|
+
ipython_config.py
|
|
81
|
+
|
|
82
|
+
# pyenv
|
|
83
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
84
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
85
|
+
.python-version
|
|
86
|
+
|
|
87
|
+
# Environments
|
|
88
|
+
.env
|
|
89
|
+
.venv
|
|
90
|
+
env/
|
|
91
|
+
venv/
|
|
92
|
+
ENV/
|
|
93
|
+
env.bak/
|
|
94
|
+
venv.bak/
|
|
95
|
+
|
|
96
|
+
# mkdocs documentation
|
|
97
|
+
/site
|
|
98
|
+
|
|
99
|
+
# mypy
|
|
100
|
+
.mypy_cache/
|
|
101
|
+
.dmypy.json
|
|
102
|
+
dmypy.json
|
|
103
|
+
|
|
104
|
+
.idea/
|
|
105
|
+
.vscode
|
|
106
|
+
|
|
107
|
+
# built connector packages
|
|
108
|
+
*.tgz
|
|
109
|
+
*.tar.gz
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# By default, run each hook only in the standard pre-commit stage
|
|
2
|
+
default_install_hook_types: [pre-commit, commit-msg]
|
|
3
|
+
default_stages: [pre-commit]
|
|
4
|
+
|
|
5
|
+
# Pre-commit hooks. Configuration examples at https://pre-commit.com/
|
|
6
|
+
repos:
|
|
7
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
8
|
+
rev: v5.0.0
|
|
9
|
+
hooks:
|
|
10
|
+
- id: trailing-whitespace
|
|
11
|
+
- id: end-of-file-fixer
|
|
12
|
+
- id: check-merge-conflict
|
|
13
|
+
- id: check-yaml
|
|
14
|
+
args:
|
|
15
|
+
- --unsafe
|
|
16
|
+
- id: check-json
|
|
17
|
+
- id: check-toml
|
|
18
|
+
|
|
19
|
+
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
20
|
+
rev: 'v0.11.6'
|
|
21
|
+
hooks:
|
|
22
|
+
- id: ruff
|
|
23
|
+
- id: ruff-format
|
|
24
|
+
|
|
25
|
+
- repo: local
|
|
26
|
+
hooks:
|
|
27
|
+
- id: uv-lock
|
|
28
|
+
name: uv-lock
|
|
29
|
+
language: system
|
|
30
|
+
entry: uv lock
|
|
31
|
+
files: ^pyproject\.toml$
|
|
32
|
+
pass_filenames: false
|
|
33
|
+
- id: mypy
|
|
34
|
+
name: mypy
|
|
35
|
+
language: system
|
|
36
|
+
entry: uv run mypy .
|
|
37
|
+
types: [python]
|
|
38
|
+
pass_filenames: false
|
|
39
|
+
|
|
40
|
+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
|
41
|
+
rev: v9.22.0
|
|
42
|
+
hooks:
|
|
43
|
+
- id: commitlint
|
|
44
|
+
stages: [commit-msg]
|
|
45
|
+
additional_dependencies: ['@commitlint/config-conventional']
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"main",
|
|
4
|
+
{
|
|
5
|
+
"name": "alpha",
|
|
6
|
+
"prerelease": true
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "beta",
|
|
10
|
+
"prerelease": true
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"tagFormat": "${version}",
|
|
14
|
+
"plugins": [
|
|
15
|
+
"@semantic-release/commit-analyzer",
|
|
16
|
+
"@semantic-release/release-notes-generator",
|
|
17
|
+
[
|
|
18
|
+
"@semantic-release/exec",
|
|
19
|
+
{
|
|
20
|
+
"prepareCmd": "uv run .github/utils/update_version.py ${nextRelease.version} && uv lock",
|
|
21
|
+
"verifyReleaseCmd": "echo \"${nextRelease.version}\" > release_version.txt",
|
|
22
|
+
"generateNotesCmd": "echo \"${nextRelease.notes}\" > release_notes.txt"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"@semantic-release/git",
|
|
27
|
+
{
|
|
28
|
+
"assets": [
|
|
29
|
+
"pyproject.toml",
|
|
30
|
+
"uv.lock"
|
|
31
|
+
],
|
|
32
|
+
"message": "chore(release): update version to ${nextRelease.version} [skip ci]"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"@semantic-release/github"
|
|
36
|
+
]
|
|
37
|
+
}
|