From 3dc9e85f7b9dd4e6b1c0232daa1db84e711c9601 Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Mon, 26 Feb 2024 14:37:37 +0100 Subject: [PATCH] :bookmark: Release v0.0.2 (#20) * :sparkles: Add auto generated Changelog * :sparkles: Add running workflow publish with dry-run with branch starting with release/v* * :construction_worker: Set Release Version * :bookmark: Bump version to 0.0.2 * :green_heart: Add git-cliff install * :construction_worker: Add dry run for crates and bolt sdk * :green_heart: Fix workflows * :green_heart: Fix CI/CD * :construction_worker: Update CI/CD * :construction_worker: Fix crates publishing * :bug: Fix missing eslint * :construction_worker: Update workflow * :construction_worker: Edit workflow * :construction_worker: Update workflow * :construction_worker: Fix CI * :green_heart: Fix CI/CD * :green_heart: Fix CI skip step --- .github/workflows/publish-bolt-crates.yml | 46 ++++++--- .github/workflows/publish-bolt-sdk.yml | 23 ++++- .github/workflows/publish-packages.yml | 45 +++++++-- .github/workflows/run-tests.yml | 11 +-- CHANGELOG.md | 26 +++++ Cargo.lock | 38 ++++---- Cargo.toml | 22 +++-- cli/npm-package/package.json | 16 ++-- cli/npm-package/package.json.tmpl | 2 +- clients/bolt-sdk/package.json | 2 +- cliff.toml | 95 +++++++++++++++++++ .../attribute/system-template/Cargo.toml | 14 ++- .../attribute/world-apply/Cargo.toml | 14 ++- .../component-deserialize/Cargo.toml | 2 +- .../bolt-lang/attribute/component/Cargo.toml | 2 +- programs/bolt-component/Cargo.toml | 2 +- programs/bolt-system/Cargo.toml | 2 +- programs/world/Cargo.toml | 6 +- version-align.sh | 3 + 19 files changed, 285 insertions(+), 86 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 cliff.toml diff --git a/.github/workflows/publish-bolt-crates.yml b/.github/workflows/publish-bolt-crates.yml index 17c4f1a..12fe063 100644 --- a/.github/workflows/publish-bolt-crates.yml +++ b/.github/workflows/publish-bolt-crates.yml @@ -1,7 +1,10 @@ name: Publish Bolt crates on: release: - types: [published] + types: [ published ] + push: + branches: + - 'release/v*' workflow_dispatch: env: @@ -91,7 +94,7 @@ jobs: - name: Run lint run: yarn lint - test: + test-and-publish: needs: [clippy-lint, yarn-lint] runs-on: ubuntu-latest @@ -106,6 +109,10 @@ jobs: - uses: actions/checkout@v4 + - name: Set DRY_RUN based on trigger + run: echo "DRY_RUN=true" >> $GITHUB_ENV + if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v') + - name: Use Node ${{ matrix.node }} uses: actions/setup-node@v4 with: @@ -151,7 +158,8 @@ jobs: - name: Check versions are aligned run: | # Fails if versions are not aligned - ./scripts/version-align.sh --check + cargo install git-cliff + ./version-align.sh --check - name: run build run: | @@ -173,16 +181,26 @@ jobs: - name: cargo publish run: | - cargo publish --manifest-path=crates/bolt-lang/attribute/account/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=crates/bolt-lang/attribute/component/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=crates/bolt-lang/attribute/component-deserialize/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=crates/bolt-lang/attribute/component-id/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=crates/bolt-lang/attribute/system/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=crates/bolt-lang/attribute/system-input/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=crates/bolt-lang/attribute/bolt-program/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=programs/bolt-system/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=programs/bolt-component/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=programs/world/Cargo.toml --token ${CRATES_TOKEN} - cargo publish --manifest-path=crates/bolt-lang/Cargo.toml --token ${CRATES_TOKEN} + DRY_RUN_FLAG="" + if [ "${DRY_RUN}" = "true" ]; then + DRY_RUN_FLAG="--dry-run" + fi + + if [ "${DRY_RUN}" = "true" ]; then + NO_VERIFY_FLAG="--no-verify" + fi + + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-deserialize/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-id/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system-input/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/bolt-program/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/utils/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-system/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-component/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=programs/world/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} + DRY_RUN: ${{ env.DRY_RUN }} diff --git a/.github/workflows/publish-bolt-sdk.yml b/.github/workflows/publish-bolt-sdk.yml index 077e26f..e12e159 100644 --- a/.github/workflows/publish-bolt-sdk.yml +++ b/.github/workflows/publish-bolt-sdk.yml @@ -1,7 +1,10 @@ name: Publish Bolt SDKs on: release: - types: [published] + types: [ published ] + push: + branches: + - 'release/v*' workflow_dispatch: env: @@ -106,6 +109,10 @@ jobs: - uses: actions/checkout@v4 + - name: Set DRY_RUN based on trigger + run: echo "DRY_RUN=true" >> $GITHUB_ENV + if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v') + - name: Use Node ${{ matrix.node }} uses: actions/setup-node@v4 with: @@ -151,7 +158,8 @@ jobs: - name: Check versions are aligned run: | # Fails if versions are not aligned - ./scripts/version-align.sh --check + cargo install git-cliff + ./version-align.sh --check - name: run build run: | @@ -173,9 +181,18 @@ jobs: - name: npm publish run: | + npm install --global yarn + npm install --global eslint + yarn install echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} cd clients/bolt-sdk/ && yarn build && yarn lint:fix && cd ../../ && yarn lint:fix - cd clients/bolt-sdk/ && npm publish + cd clients/bolt-sdk/ + if [ "${DRY_RUN}" = "true" ]; then + echo "Running npm publish in dry-run mode" + npm publish --access public --dry-run + else + npm publish --access public + fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 4e14c6c..bf5030a 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -2,6 +2,9 @@ name: Publish bolt-cli packages on: release: types: [ published ] + push: + branches: + - 'release/v*' workflow_dispatch: inputs: release_version: @@ -63,9 +66,23 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set DRY_RUN based on trigger + shell: bash + run: echo "DRY_RUN=true" >> $GITHUB_ENV + if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v') + - name: Set the release version shell: bash - run: echo "RELEASE_VERSION=${github.event.inputs.release_version || GITHUB_REF:11}" >> $GITHUB_ENV + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "RELEASE_VERSION=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "push" ]]; then + VERSION=$(echo "${GITHUB_REF}" | sed -E 's|refs/heads/release/v||') + echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "release" ]]; then + VERSION=$(echo "${GITHUB_REF}" | sed -E 's|refs/tags/v||') + echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV + fi - name: Install Rust toolchain uses: actions-rs/toolchain@v1 @@ -92,7 +109,8 @@ jobs: - name: Check versions are aligned run: | # Fails if versions are not aligned - ./scripts/version-align.sh --check + cargo install git-cliff + ./version-align.sh --check - name: Build the NPM package shell: bash @@ -130,7 +148,7 @@ jobs: cp "target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin" # Create the release bin file - release_name="bolt-${{ matrix.build.NAME }}" + release_name="bolt-cli-${{ matrix.build.NAME }}" if [ "${{ matrix.build.OS }}" = "windows-2022" ]; then release_name="${release_name}.exe" fi @@ -138,6 +156,7 @@ jobs: mv "target/${{ matrix.build.TARGET }}/release/${bin}" "target/${{ matrix.build.TARGET }}/release/${release_name}" - name: Publish binary to GitHub release + if: ${{ env.DRY_RUN != 'true' }} uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} @@ -148,12 +167,18 @@ jobs: asset_name: "${{ env.release_name }}" - name: Publish the NPM package - shell: bash run: | + echo "DRY_RUN=${{ env.DRY_RUN }}" cd ${{ env.node_pkg }} echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} - npm publish --access public + if [ "${{ env.DRY_RUN }}" = "true" ]; then + echo "Running npm publish in dry-run mode" + npm publish --access public --dry-run + else + npm publish --access public + fi + shell: bash env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-wrapper-npm-package: @@ -163,6 +188,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Set DRY_RUN based on trigger + run: echo "DRY_RUN=true" >> $GITHUB_ENV + if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v') - name: Publish the NPM package shell: bash run: | @@ -172,6 +200,11 @@ jobs: cd lib echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} - npm publish --access public + if [ "${DRY_RUN}" = "true" ]; then + echo "Running npm publish in dry-run mode" + npm publish --access public --dry-run + else + npm publish --access public + fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e1fd0b3..9aeb690 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,7 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 name: cache solana cli id: cache-solana @@ -165,6 +164,8 @@ jobs: anchor test - name: Install the Bolt CLI and create & build a new project + shell: bash + if: ${{ !startsWith(github.ref, 'refs/heads/release/v') && !startsWith(github.head_ref, 'release/v') }} run: | export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH" cargo install --path cli --force --locked @@ -174,10 +175,4 @@ jobs: cargo add --package movement --path "../crates/bolt-lang" # - yarn add file:../clients/bolt-sdk/ -D # Overrides the bolt ts SDK with the local version bolt build - bolt test - - - uses: actions/upload-artifact@v3 - if: always() - with: - name: program-logs - path: .anchor/program-logs/* \ No newline at end of file + bolt test \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e01c2bd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ + +## [0.0.2] - 2024-02-25 + +### ✨️ Features + - Feat/consistent versioning (#18) + - Draft workflow for building & publishing packages (#16) + +### 👷 CI/CD + +## [0.0.1] - 2024-02-21 + +### ✨️ Features + - Feature: Add configurable component authority & Simplify the Components/System API (#14) + - Feat/default component (#13) + - Add a working ecs example on project init (#12) + - Add strings to the template (#2) + - Bolt Typescript SDK (#1) + + +### 🐛 Bug Fixes + - Fix world Pda derivation (#10) + +### 📚 Documentation + +### ♻️ Refactor + - Refactor workspace and project dependencies (#15) diff --git a/Cargo.lock b/Cargo.lock index b09f349..e64435e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -910,7 +910,7 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bolt-attribute-bolt-component" -version = "0.0.1" +version = "0.0.2" dependencies = [ "bolt-utils", "proc-macro2", @@ -920,7 +920,7 @@ dependencies = [ [[package]] name = "bolt-attribute-bolt-component-deserialize" -version = "0.0.1" +version = "0.0.2" dependencies = [ "bolt-utils", "proc-macro2", @@ -930,7 +930,7 @@ dependencies = [ [[package]] name = "bolt-attribute-bolt-component-id" -version = "0.0.1" +version = "0.0.2" dependencies = [ "proc-macro2", "quote", @@ -939,7 +939,7 @@ dependencies = [ [[package]] name = "bolt-attribute-bolt-program" -version = "0.0.1" +version = "0.0.2" dependencies = [ "proc-macro2", "quote", @@ -948,7 +948,7 @@ dependencies = [ [[package]] name = "bolt-attribute-bolt-system" -version = "0.0.1" +version = "0.0.2" dependencies = [ "proc-macro2", "quote", @@ -957,7 +957,7 @@ dependencies = [ [[package]] name = "bolt-attribute-bolt-system-input" -version = "0.0.1" +version = "0.0.2" dependencies = [ "proc-macro2", "quote", @@ -966,7 +966,7 @@ dependencies = [ [[package]] name = "bolt-cli" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-cli", "anchor-client", @@ -978,7 +978,7 @@ dependencies = [ [[package]] name = "bolt-component" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bolt-system", @@ -990,7 +990,7 @@ version = "0.0.1" [[package]] name = "bolt-helpers-system-template" -version = "0.0.1" +version = "0.0.2" dependencies = [ "proc-macro2", "quote", @@ -999,7 +999,7 @@ dependencies = [ [[package]] name = "bolt-helpers-world-apply" -version = "0.0.1" +version = "0.0.2" dependencies = [ "proc-macro2", "quote", @@ -1008,7 +1008,7 @@ dependencies = [ [[package]] name = "bolt-lang" -version = "0.0.1" +version = "0.0.2" dependencies = [ "ahash 0.8.6", "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1026,7 +1026,7 @@ dependencies = [ [[package]] name = "bolt-system" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bolt-helpers-system-template", @@ -1034,7 +1034,7 @@ dependencies = [ [[package]] name = "bolt-utils" -version = "0.0.1" +version = "0.0.2" dependencies = [ "proc-macro2", "quote", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "position" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bolt-lang", @@ -5024,7 +5024,7 @@ dependencies = [ [[package]] name = "system-apply-velocity" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bolt-lang", @@ -5055,7 +5055,7 @@ dependencies = [ [[package]] name = "system-fly" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bolt-lang", @@ -5064,7 +5064,7 @@ dependencies = [ [[package]] name = "system-simple-movement" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bolt-lang", @@ -5559,7 +5559,7 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "velocity" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bolt-lang", @@ -5958,7 +5958,7 @@ dependencies = [ [[package]] name = "world" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anchor-lang 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "bolt-component", diff --git a/Cargo.toml b/Cargo.toml index 9c726d0..6a57d40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ ] [workspace.package] -version = "0.0.1" +version = "0.0.2" authors = ["Magicblock Labs "] repository = "https://github.com/magicblock-labs/bolt" homepage = "https://www.magicblock.gg/" @@ -15,14 +15,18 @@ license = "MIT" edition = "2021" [workspace.dependencies] -bolt-attribute-bolt-program = { path = "crates/bolt-lang/attribute/bolt-program", version = "=0.0.1" } -bolt-attribute-bolt-component = { path = "crates/bolt-lang/attribute/component", version = "=0.0.1" } -bolt-attribute-bolt-system = { path = "crates/bolt-lang/attribute/system", version = "=0.0.1"} -bolt-attribute-bolt-system-input = { path = "crates/bolt-lang/attribute/system-input", version = "=0.0.1" } -bolt-attribute-bolt-component-deserialize = { path = "crates/bolt-lang/attribute/component-deserialize", version = "=0.0.1" } -bolt-attribute-bolt-component-id = { path = "crates/bolt-lang/attribute/component-id", version = "=0.0.1" } -world = { path = "programs/world", features = ["cpi"], version = "=0.0.1"} -bolt-system = { path = "programs/bolt-system", features = ["cpi"], version = "=0.0.1"} +bolt-attribute-bolt-program = { path = "crates/bolt-lang/attribute/bolt-program", version = "=0.0.2" } +bolt-attribute-bolt-component = { path = "crates/bolt-lang/attribute/component", version = "=0.0.2" } +bolt-attribute-bolt-system = { path = "crates/bolt-lang/attribute/system", version = "=0.0.2"} +bolt-attribute-bolt-system-input = { path = "crates/bolt-lang/attribute/system-input", version = "=0.0.2" } +bolt-attribute-bolt-component-deserialize = { path = "crates/bolt-lang/attribute/component-deserialize", version = "=0.0.2" } +bolt-attribute-bolt-component-id = { path = "crates/bolt-lang/attribute/component-id", version = "=0.0.2" } +bolt-helpers-system-template = { path = "crates/bolt-helpers/attribute/system-template", version = "=0.0.2" } +bolt-helpers-world-apply = { path = "crates/bolt-helpers/attribute/world-apply", version = "=0.0.2" } +bolt-utils = { path = "crates/bolt-lang/utils", version = "=0.0.2" } +world = { path = "programs/world", features = ["cpi"], version = "=0.0.2"} +bolt-system = { path = "programs/bolt-system", features = ["cpi"], version = "=0.0.2"} +bolt-component = { path = "programs/bolt-component", features = ["cpi"], version = "=0.0.2"} ## External crates anchor-lang = "0.29.0" diff --git a/cli/npm-package/package.json b/cli/npm-package/package.json index 7f628d5..363f5c6 100644 --- a/cli/npm-package/package.json +++ b/cli/npm-package/package.json @@ -1,6 +1,6 @@ { "name": "@magicblock-labs/bolt-cli", - "version": "0.0.1", + "version": "0.0.2", "description": "Bolt CLI tool", "homepage": "https://github.com/magicblock-labs/bolt#readme", "bugs": { @@ -29,13 +29,13 @@ "typescript": "^4.9.4" }, "optionalDependencies": { - "@magicblock-labs/bolt-cli-darwin-x64": "0.0.1", - "@magicblock-labs/bolt-cli-darwin-arm64": "0.0.1", - "@magicblock-labs/bolt-cli-linux-x86": "0.0.1", - "@magicblock-labs/bolt-cli-linux-x64": "0.0.1", - "@magicblock-labs/bolt-cli-linux-arm64": "0.0.1", - "@magicblock-labs/bolt-cli-windows-x86": "0.0.1", - "@magicblock-labs/bolt-cli-windows-x64": "0.0.1" + "@magicblock-labs/bolt-cli-darwin-x64": "0.0.2", + "@magicblock-labs/bolt-cli-darwin-arm64": "0.0.2", + "@magicblock-labs/bolt-cli-linux-x86": "0.0.2", + "@magicblock-labs/bolt-cli-linux-x64": "0.0.2", + "@magicblock-labs/bolt-cli-linux-arm64": "0.0.2", + "@magicblock-labs/bolt-cli-windows-x86": "0.0.2", + "@magicblock-labs/bolt-cli-windows-x64": "0.0.2" }, "publishConfig": { "access": "public" diff --git a/cli/npm-package/package.json.tmpl b/cli/npm-package/package.json.tmpl index fb16ca9..0d58b60 100644 --- a/cli/npm-package/package.json.tmpl +++ b/cli/npm-package/package.json.tmpl @@ -1,7 +1,7 @@ { "name": "@magicblock-labs/${node_pkg}", "description": "Bolt CLI tool (${node_pkg})", - "version": "0.0.1", + "version": "0.0.2", "repository": { "type": "git", "url": "git+https://github.com/magicblock-labs/bolt.git" diff --git a/clients/bolt-sdk/package.json b/clients/bolt-sdk/package.json index 5c33711..10ecc34 100644 --- a/clients/bolt-sdk/package.json +++ b/clients/bolt-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@magicblock-labs/bolt-sdk", - "version": "0.0.1", + "version": "0.0.2", "description": "Bolt typescript SDK", "author": "dev@magicblock.gg", "license": "MIT", diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..46aef45 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,95 @@ +# git-cliff ~ configuration file +# https://git-cliff.org/docs/configuration +# +# Lines starting with "#" are comments. +# Configuration options are organized into tables and keys. +# See documentation for more information on available options. + +[changelog] +# template for the changelog body +# https://keats.github.io/tera/docs/#introduction +body = """ +{%- macro remote_url() -%} + https://github.com/magicblock-labs/bolt +{%- endmacro -%} + +{% macro print_commit(commit) -%} + {% if commit.message is matching("#") %} \ + - {{ commit.message | upper_first }} \ + {% endif %} \ +{% endmacro -%} + +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ + +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits + | filter(attribute="scope") + | unique(attribute="message") + | sort(attribute="scope") %} + {{ self::print_commit(commit=commit) }} + {%- endfor -%} + {% raw %}\n{% endraw %}\ + {%- for commit in commits %} + {%- if not commit.scope -%} + {{ self::print_commit(commit=commit) }} + {% endif -%} + {% endfor -%} +{% endfor %}\n +""" +# remove the leading and trailing whitespace from the templates +trim = true +# postprocessors +postprocessors = [ + { pattern = '', replace = "https://github.com/magicblock-labs/bolt" }, + { pattern = '\* :.*', replace = "" }, + { pattern = '\s*\n', replace = "\n" }, + { pattern = '\n.*(R|r)elease.*\n', replace = "" }, + { pattern = '### 🐛 Bug Fixes', replace = "\n### 🐛 Bug Fixes" }, + { pattern = '##', replace = "\n##" }, + { pattern = '- *(:\w+:|[\p{Emoji_Presentation}\p{Extended_Pictographic}](?:\u{FE0F})?\u{200D}?) *', replace = "- " }, +] + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = false +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +#commit_preprocessors = [ +# # Check spelling of the commit with https://github.com/crate-ci/typos +# # If the spelling is incorrect, it will be automatically fixed. +# { pattern = '.*', replace_command = 'typos --write-changes -' }, +#] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^Feat", group = "✨️ Features" }, + { message = "^:sparkles:", group = "✨️ Features" }, + { message = "^Feature", group = "✨️ Features" }, + { message = "^:bug:", group = "🐛 Bug Fixes" }, + { message = ":memo:", group = "📚 Documentation" }, + { message = "^:zap:", group = "⚡️ Performance" }, + { message = "^:art:", group = "🎨 Styling" }, + { message = "^:construction_worker:", group = "👷 CI/CD" }, + { message = "^:recycle:", group = "♻️ Refactor" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = false +# filter out the commits that are not matched by commit parsers +filter_commits = true +# regex for matching git tags +tag_pattern = "v[0-9].*" +# regex for skipping tags +skip_tags = "beta|alpha" +# regex for ignoring tags +ignore_tags = "rc" +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "newest" \ No newline at end of file diff --git a/crates/bolt-helpers/attribute/system-template/Cargo.toml b/crates/bolt-helpers/attribute/system-template/Cargo.toml index a096842..c3e480b 100644 --- a/crates/bolt-helpers/attribute/system-template/Cargo.toml +++ b/crates/bolt-helpers/attribute/system-template/Cargo.toml @@ -1,12 +1,16 @@ [package] name = "bolt-helpers-system-template" -version = "0.0.1" -edition = "2021" +version = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +edition = { workspace = true } [lib] proc-macro = true [dependencies] -proc-macro2 = "1.0" -quote = "1.0" -syn = "1.0" \ No newline at end of file +proc-macro2 = { workspace = true } +quote = { workspace = true } +syn = { workspace = true } \ No newline at end of file diff --git a/crates/bolt-helpers/attribute/world-apply/Cargo.toml b/crates/bolt-helpers/attribute/world-apply/Cargo.toml index 827779a..d3d5e8d 100644 --- a/crates/bolt-helpers/attribute/world-apply/Cargo.toml +++ b/crates/bolt-helpers/attribute/world-apply/Cargo.toml @@ -1,12 +1,16 @@ [package] name = "bolt-helpers-world-apply" -version = "0.0.1" -edition = "2021" +version = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +edition = { workspace = true } [lib] proc-macro = true [dependencies] -proc-macro2 = "1.0" -quote = "1.0" -syn = "1.0" \ No newline at end of file +proc-macro2 = { workspace = true } +quote = { workspace = true } +syn = { workspace = true } \ No newline at end of file diff --git a/crates/bolt-lang/attribute/component-deserialize/Cargo.toml b/crates/bolt-lang/attribute/component-deserialize/Cargo.toml index da67883..89ff8eb 100644 --- a/crates/bolt-lang/attribute/component-deserialize/Cargo.toml +++ b/crates/bolt-lang/attribute/component-deserialize/Cargo.toml @@ -13,6 +13,6 @@ proc-macro = true [dependencies] syn = { workspace = true } -bolt-utils = { path = "../../utils" } +bolt-utils = { workspace = true } quote = { workspace = true } proc-macro2 = { workspace = true } diff --git a/crates/bolt-lang/attribute/component/Cargo.toml b/crates/bolt-lang/attribute/component/Cargo.toml index c3066ae..39e8ca6 100644 --- a/crates/bolt-lang/attribute/component/Cargo.toml +++ b/crates/bolt-lang/attribute/component/Cargo.toml @@ -13,6 +13,6 @@ proc-macro = true [dependencies] syn = { workspace = true } -bolt-utils = { path = "../../utils" } +bolt-utils = { workspace = true } quote = { workspace = true } proc-macro2 = { workspace = true } \ No newline at end of file diff --git a/programs/bolt-component/Cargo.toml b/programs/bolt-component/Cargo.toml index c402a56..2b2d0fa 100644 --- a/programs/bolt-component/Cargo.toml +++ b/programs/bolt-component/Cargo.toml @@ -22,4 +22,4 @@ idl-build = ["anchor-lang/idl-build"] [dependencies] anchor-lang = { workspace = true, features = ["init-if-needed"] } -bolt-system = { path = "../bolt-system", features = ["cpi"] } \ No newline at end of file +bolt-system = { workspace = true, cpi = true } \ No newline at end of file diff --git a/programs/bolt-system/Cargo.toml b/programs/bolt-system/Cargo.toml index e39b011..d6cd7ca 100644 --- a/programs/bolt-system/Cargo.toml +++ b/programs/bolt-system/Cargo.toml @@ -22,4 +22,4 @@ idl-build = ["anchor-lang/idl-build"] [dependencies] anchor-lang = { workspace = true } -bolt-helpers-system-template = { path = "../../crates/bolt-helpers/attribute/system-template" } \ No newline at end of file +bolt-helpers-system-template = { workspace = true, cpi = true } \ No newline at end of file diff --git a/programs/world/Cargo.toml b/programs/world/Cargo.toml index 8a26b15..a64dff0 100644 --- a/programs/world/Cargo.toml +++ b/programs/world/Cargo.toml @@ -22,9 +22,9 @@ idl-build = ["anchor-lang/idl-build"] [dependencies] anchor-lang = { workspace = true, features = ["init-if-needed"] } -bolt-component = { path = "../../programs/bolt-component", features = ["cpi"]} -bolt-helpers-world-apply = { path = "../../crates/bolt-helpers/attribute/world-apply" } -bolt-system = { path = "../../programs/bolt-system", features = ["cpi"]} +bolt-component = { workspace = true, cpi = true } +bolt-helpers-world-apply = { workspace = true } +bolt-system = { workspace = true, cpi = true } solana-security-txt = { workspace = true } tuple-conv = { workspace = true } diff --git a/version-align.sh b/version-align.sh index 9f1b2ad..8de2bbe 100755 --- a/version-align.sh +++ b/version-align.sh @@ -34,6 +34,8 @@ jq --arg version "$version" '(.version = $version) | (.optionalDependencies[] = # Potential for collisions in Cargo.lock, use cargo update to update it cargo update --workspace +# Generate CHANGELOG.md +git-cliff -c cliff.toml -o CHANGELOG.md -t $version # Check if the any changes have been made to the specified files, if running with --check if [[ "$1" == "--check" ]]; then @@ -42,6 +44,7 @@ if [[ "$1" == "--check" ]]; then "cli/npm-package/package.json.tmpl" "cli/npm-package/package.json" "Cargo.toml" + "CHANGELOG.toml" ) for file in "${files_to_check[@]}"; do