diff --git a/.auto-changelog b/.auto-changelog new file mode 100644 index 00000000..8fb54f02 --- /dev/null +++ b/.auto-changelog @@ -0,0 +1,11 @@ +{ + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": 0, + "backfillLimit": 3, + "hideCredit": true, + "replaceText": { + "\\[([^\\]]+)\\]\\(https://github.com/[^/]+/[^/]+/compare/[^)]+\\)": "[$1](https://github.com/fireblocks/ts-sdk/releases/tag/$1)" + } +} \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 197fe048..00000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,56 +0,0 @@ -name-template: 'v$RESOLVED_VERSION' -tag-template: 'v$RESOLVED_VERSION' -categories: - - title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' - - title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '🧰 Maintenance' - label: 'chore' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. -version-resolver: - major: - labels: - - 'major' - - 'breaking' - minor: - labels: - - 'minor' - - 'enhancement' - patch: - labels: - - 'patch' - - 'bug' - default: patch -template: | - ## Changes - - $CHANGES -autolabeler: - - label: 'chore' - files: - - '*.md' - branch: - - '/docs{0,1}\/.+/' - - label: 'bug' - branch: - - '/fix\/.+/' - title: - - '/fix/i' - - '/bugfix/i' - - label: 'enhancement' - title: - - '/added/i' - - '/add/i' - - '/feature/i' - - '/feat/i' - - '/support/i' - - '/enable/i' - branch: - - '/feature\/.+/' diff --git a/.github/workflows/draft-release-from-pr.yml b/.github/workflows/draft-release-from-pr.yml new file mode 100644 index 00000000..f547cbcf --- /dev/null +++ b/.github/workflows/draft-release-from-pr.yml @@ -0,0 +1,91 @@ +name: Draft Release from PR + +on: + push: + branches: + - master_changelog_test + +permissions: + contents: write + pull-requests: read + +jobs: + draft-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get last merged PR + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr list \ + --state merged \ + --base master_changelog_test \ + --limit 1 \ + --json number,title,body,labels \ + > pr.json + + PR_NUM=$(jq -r '.[0].number // "none"' pr.json) + PR_TITLE=$(jq -r '.[0].title // "none"' pr.json) + echo "Found merged PR: #$PR_NUM - $PR_TITLE" + + - name: Get latest release version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + LAST_TAG=$(gh release list --limit 1 --json tagName -q '.[0].tagName') + + if [[ -z "$LAST_TAG" || "$LAST_TAG" == "null" ]]; then + echo "No existing release found, starting from v0.1.0" + echo "LAST_TAG=v0.1.0" >> $GITHUB_ENV + else + echo "Found latest release: $LAST_TAG" + echo "LAST_TAG=$LAST_TAG" >> $GITHUB_ENV + fi + + - name: Calculate next version from labels + run: | + V="${LAST_TAG#v}" + + MAJOR=$(echo $V | cut -d. -f1) + MINOR=$(echo $V | cut -d. -f2) + PATCH=$(echo $V | cut -d. -f3) + + LABELS=$(jq -r '.[0].labels[].name' pr.json) + echo "Found labels: $LABELS" + + if echo "$LABELS" | grep -q "major"; then + echo "Bumping MAJOR version" + MAJOR=$((MAJOR+1)) + MINOR=0 + PATCH=0 + elif echo "$LABELS" | grep -q "minor"; then + echo "Bumping MINOR version" + MINOR=$((MINOR+1)) + PATCH=0 + else + echo "Bumping PATCH version" + PATCH=$((PATCH+1)) + fi + + echo "Calculated next version: v$MAJOR.$MINOR.$PATCH" + echo "VERSION=v$MAJOR.$MINOR.$PATCH" >> $GITHUB_ENV + + - name: Create DRAFT release using PR BODY + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_BODY=$(jq -r '.[0].body // ""' pr.json) + + echo "Creating draft release..." + echo "Version: $VERSION" + + gh release create "$VERSION" \ + --draft \ + --title "$VERSION" \ + --notes "$PR_BODY" + + echo "Draft release created successfully!" \ No newline at end of file diff --git a/.github/workflows/pr-auto-label.yml b/.github/workflows/pr-auto-label.yml new file mode 100644 index 00000000..e5df470a --- /dev/null +++ b/.github/workflows/pr-auto-label.yml @@ -0,0 +1,37 @@ +name: PR Auto Label + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + +permissions: + pull-requests: write + contents: read + +jobs: + label: + runs-on: ubuntu-latest + steps: + - name: Label PR by title + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TITLE: ${{ github.event.pull_request.title }} + PR: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + label="" + + if [[ "$TITLE" =~ \(major\) ]]; then + label="major" + elif [[ "$TITLE" =~ \(minor\) ]]; then + label="minor" + elif [[ "$TITLE" =~ \(patch\) ]]; then + label="patch" + fi + + if [[ -n "$label" ]]; then + echo "Found label: $label" + gh pr edit "$PR" --repo "$REPO" --add-label "$label" + else + echo "No label found in title: $TITLE" + fi diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title-validation.yml similarity index 87% rename from .github/workflows/pr-title.yml rename to .github/workflows/pr-title-validation.yml index b9ada4e0..6cf926de 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title-validation.yml @@ -9,4 +9,4 @@ jobs: - uses: deepakputhraya/action-pr-title@master with: disallowed_prefixes: 'COR-' - prefix_case_sensitive: false \ No newline at end of file + prefix_case_sensitive: false diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index ecba06c6..00000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Release Drafter - -on: - push: - branches: - - master - pull_request: - types: [opened, reopened, synchronize] - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/UnmanagedWallet.md b/docs/UnmanagedWallet.md index e4743b37..d6c63df0 100644 --- a/docs/UnmanagedWallet.md +++ b/docs/UnmanagedWallet.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **name** | **str** | | **customer_ref_id** | **str** | | [optional] **assets** | [**List[WalletAsset]**](WalletAsset.md) | | +**test** | **bool** | | ## Example diff --git a/fireblocks/__init__.py b/fireblocks/__init__.py index 32f3248e..a5610167 100644 --- a/fireblocks/__init__.py +++ b/fireblocks/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "14.0.0" +__version__ = "0.0.0" # import apis into sdk package from fireblocks.api.api_user_api import ApiUserApi diff --git a/fireblocks/configuration.py b/fireblocks/configuration.py index cd7c1bbd..3f2e5962 100644 --- a/fireblocks/configuration.py +++ b/fireblocks/configuration.py @@ -552,7 +552,7 @@ def to_debug_report(self) -> str: "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: 1.6.2\n" - "SDK Package Version: 14.0.0".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 0.0.0".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self) -> List[HostSetting]: diff --git a/fireblocks/models/unmanaged_wallet.py b/fireblocks/models/unmanaged_wallet.py index 13074db5..6fd4d1a7 100644 --- a/fireblocks/models/unmanaged_wallet.py +++ b/fireblocks/models/unmanaged_wallet.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from fireblocks.models.wallet_asset import WalletAsset from typing import Optional, Set @@ -32,7 +32,8 @@ class UnmanagedWallet(BaseModel): name: StrictStr customer_ref_id: Optional[StrictStr] = Field(default=None, alias="customerRefId") assets: List[WalletAsset] - __properties: ClassVar[List[str]] = ["id", "name", "customerRefId", "assets"] + test: StrictBool + __properties: ClassVar[List[str]] = ["id", "name", "customerRefId", "assets", "test"] model_config = ConfigDict( populate_by_name=True, @@ -95,7 +96,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "name": obj.get("name"), "customerRefId": obj.get("customerRefId"), - "assets": [WalletAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None + "assets": [WalletAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None, + "test": obj.get("test") }) return _obj diff --git a/pyproject.toml b/pyproject.toml index 6b11a64b..08a27f53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireblocks" -version = "14.0.0" +version = "0.0.0" description = "Fireblocks API" authors = ["Fireblocks "] license = "MIT License" diff --git a/setup.py b/setup.py index ab8d98bf..8e55f57b 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "fireblocks" -VERSION = "14.0.0" +VERSION = "0.0.0" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", diff --git a/test/test_paginated_assets_response.py b/test/test_paginated_assets_response.py index 802b8edb..0f4f1f7e 100644 --- a/test/test_paginated_assets_response.py +++ b/test/test_paginated_assets_response.py @@ -51,7 +51,8 @@ def make_instance(self, include_optional) -> PaginatedAssetsResponse: address = '', tag = '', activation_time = '', ) - ], ), + ], + test = True, ), next = '' ) else: @@ -69,7 +70,8 @@ def make_instance(self, include_optional) -> PaginatedAssetsResponse: address = '', tag = '', activation_time = '', ) - ], ), + ], + test = True, ), ) """ diff --git a/test/test_unmanaged_wallet.py b/test/test_unmanaged_wallet.py index 5d639be2..91e05f9c 100644 --- a/test/test_unmanaged_wallet.py +++ b/test/test_unmanaged_wallet.py @@ -49,7 +49,8 @@ def make_instance(self, include_optional) -> UnmanagedWallet: address = '', tag = '', activation_time = '', ) - ] + ], + test = True ) else: return UnmanagedWallet( @@ -65,6 +66,7 @@ def make_instance(self, include_optional) -> UnmanagedWallet: tag = '', activation_time = '', ) ], + test = True, ) """