Skip to content

Commit 3dc9e85

Browse files
🔖 Release v0.0.2 (#20)
* ✨ Add auto generated Changelog * ✨ Add running workflow publish with dry-run with branch starting with release/v* * 👷 Set Release Version * 🔖 Bump version to 0.0.2 * 💚 Add git-cliff install * 👷 Add dry run for crates and bolt sdk * 💚 Fix workflows * 💚 Fix CI/CD * 👷 Update CI/CD * 👷 Fix crates publishing * 🐛 Fix missing eslint * 👷 Update workflow * 👷 Edit workflow * 👷 Update workflow * 👷 Fix CI * 💚 Fix CI/CD * 💚 Fix CI skip step
1 parent b34d50d commit 3dc9e85

File tree

19 files changed

+285
-86
lines changed

19 files changed

+285
-86
lines changed

.github/workflows/publish-bolt-crates.yml

+32-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: Publish Bolt crates
22
on:
33
release:
4-
types: [published]
4+
types: [ published ]
5+
push:
6+
branches:
7+
- 'release/v*'
58
workflow_dispatch:
69

710
env:
@@ -91,7 +94,7 @@ jobs:
9194
- name: Run lint
9295
run: yarn lint
9396

94-
test:
97+
test-and-publish:
9598
needs: [clippy-lint, yarn-lint]
9699
runs-on: ubuntu-latest
97100

@@ -106,6 +109,10 @@ jobs:
106109

107110
- uses: actions/checkout@v4
108111

112+
- name: Set DRY_RUN based on trigger
113+
run: echo "DRY_RUN=true" >> $GITHUB_ENV
114+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v')
115+
109116
- name: Use Node ${{ matrix.node }}
110117
uses: actions/setup-node@v4
111118
with:
@@ -151,7 +158,8 @@ jobs:
151158
- name: Check versions are aligned
152159
run: |
153160
# Fails if versions are not aligned
154-
./scripts/version-align.sh --check
161+
cargo install git-cliff
162+
./version-align.sh --check
155163
156164
- name: run build
157165
run: |
@@ -173,16 +181,26 @@ jobs:
173181
174182
- name: cargo publish
175183
run: |
176-
cargo publish --manifest-path=crates/bolt-lang/attribute/account/Cargo.toml --token ${CRATES_TOKEN}
177-
cargo publish --manifest-path=crates/bolt-lang/attribute/component/Cargo.toml --token ${CRATES_TOKEN}
178-
cargo publish --manifest-path=crates/bolt-lang/attribute/component-deserialize/Cargo.toml --token ${CRATES_TOKEN}
179-
cargo publish --manifest-path=crates/bolt-lang/attribute/component-id/Cargo.toml --token ${CRATES_TOKEN}
180-
cargo publish --manifest-path=crates/bolt-lang/attribute/system/Cargo.toml --token ${CRATES_TOKEN}
181-
cargo publish --manifest-path=crates/bolt-lang/attribute/system-input/Cargo.toml --token ${CRATES_TOKEN}
182-
cargo publish --manifest-path=crates/bolt-lang/attribute/bolt-program/Cargo.toml --token ${CRATES_TOKEN}
183-
cargo publish --manifest-path=programs/bolt-system/Cargo.toml --token ${CRATES_TOKEN}
184-
cargo publish --manifest-path=programs/bolt-component/Cargo.toml --token ${CRATES_TOKEN}
185-
cargo publish --manifest-path=programs/world/Cargo.toml --token ${CRATES_TOKEN}
186-
cargo publish --manifest-path=crates/bolt-lang/Cargo.toml --token ${CRATES_TOKEN}
184+
DRY_RUN_FLAG=""
185+
if [ "${DRY_RUN}" = "true" ]; then
186+
DRY_RUN_FLAG="--dry-run"
187+
fi
188+
189+
if [ "${DRY_RUN}" = "true" ]; then
190+
NO_VERIFY_FLAG="--no-verify"
191+
fi
192+
193+
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
194+
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-deserialize/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
195+
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-id/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
196+
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
197+
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system-input/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
198+
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/bolt-program/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
199+
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/utils/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
200+
cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-system/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
201+
cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-component/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
202+
cargo publish $DRY_RUN_FLAG --manifest-path=programs/world/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
203+
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG
187204
env:
188205
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
206+
DRY_RUN: ${{ env.DRY_RUN }}

.github/workflows/publish-bolt-sdk.yml

+20-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: Publish Bolt SDKs
22
on:
33
release:
4-
types: [published]
4+
types: [ published ]
5+
push:
6+
branches:
7+
- 'release/v*'
58
workflow_dispatch:
69

710
env:
@@ -106,6 +109,10 @@ jobs:
106109

107110
- uses: actions/checkout@v4
108111

112+
- name: Set DRY_RUN based on trigger
113+
run: echo "DRY_RUN=true" >> $GITHUB_ENV
114+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v')
115+
109116
- name: Use Node ${{ matrix.node }}
110117
uses: actions/setup-node@v4
111118
with:
@@ -151,7 +158,8 @@ jobs:
151158
- name: Check versions are aligned
152159
run: |
153160
# Fails if versions are not aligned
154-
./scripts/version-align.sh --check
161+
cargo install git-cliff
162+
./version-align.sh --check
155163
156164
- name: run build
157165
run: |
@@ -173,9 +181,18 @@ jobs:
173181
174182
- name: npm publish
175183
run: |
184+
npm install --global yarn
185+
npm install --global eslint
186+
yarn install
176187
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
177188
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
178189
cd clients/bolt-sdk/ && yarn build && yarn lint:fix && cd ../../ && yarn lint:fix
179-
cd clients/bolt-sdk/ && npm publish
190+
cd clients/bolt-sdk/
191+
if [ "${DRY_RUN}" = "true" ]; then
192+
echo "Running npm publish in dry-run mode"
193+
npm publish --access public --dry-run
194+
else
195+
npm publish --access public
196+
fi
180197
env:
181198
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish-packages.yml

+39-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Publish bolt-cli packages
22
on:
33
release:
44
types: [ published ]
5+
push:
6+
branches:
7+
- 'release/v*'
58
workflow_dispatch:
69
inputs:
710
release_version:
@@ -63,9 +66,23 @@ jobs:
6366
- name: Checkout
6467
uses: actions/checkout@v4
6568

69+
- name: Set DRY_RUN based on trigger
70+
shell: bash
71+
run: echo "DRY_RUN=true" >> $GITHUB_ENV
72+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v')
73+
6674
- name: Set the release version
6775
shell: bash
68-
run: echo "RELEASE_VERSION=${github.event.inputs.release_version || GITHUB_REF:11}" >> $GITHUB_ENV
76+
run: |
77+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
78+
echo "RELEASE_VERSION=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV
79+
elif [[ "${{ github.event_name }}" == "push" ]]; then
80+
VERSION=$(echo "${GITHUB_REF}" | sed -E 's|refs/heads/release/v||')
81+
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
82+
elif [[ "${{ github.event_name }}" == "release" ]]; then
83+
VERSION=$(echo "${GITHUB_REF}" | sed -E 's|refs/tags/v||')
84+
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
85+
fi
6986
7087
- name: Install Rust toolchain
7188
uses: actions-rs/toolchain@v1
@@ -92,7 +109,8 @@ jobs:
92109
- name: Check versions are aligned
93110
run: |
94111
# Fails if versions are not aligned
95-
./scripts/version-align.sh --check
112+
cargo install git-cliff
113+
./version-align.sh --check
96114
97115
- name: Build the NPM package
98116
shell: bash
@@ -130,14 +148,15 @@ jobs:
130148
cp "target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin"
131149
132150
# Create the release bin file
133-
release_name="bolt-${{ matrix.build.NAME }}"
151+
release_name="bolt-cli-${{ matrix.build.NAME }}"
134152
if [ "${{ matrix.build.OS }}" = "windows-2022" ]; then
135153
release_name="${release_name}.exe"
136154
fi
137155
echo "release_name=${release_name}" >> $GITHUB_ENV
138156
mv "target/${{ matrix.build.TARGET }}/release/${bin}" "target/${{ matrix.build.TARGET }}/release/${release_name}"
139157
140158
- name: Publish binary to GitHub release
159+
if: ${{ env.DRY_RUN != 'true' }}
141160
uses: svenstaro/upload-release-action@v2
142161
with:
143162
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -148,12 +167,18 @@ jobs:
148167
asset_name: "${{ env.release_name }}"
149168

150169
- name: Publish the NPM package
151-
shell: bash
152170
run: |
171+
echo "DRY_RUN=${{ env.DRY_RUN }}"
153172
cd ${{ env.node_pkg }}
154173
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
155174
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
156-
npm publish --access public
175+
if [ "${{ env.DRY_RUN }}" = "true" ]; then
176+
echo "Running npm publish in dry-run mode"
177+
npm publish --access public --dry-run
178+
else
179+
npm publish --access public
180+
fi
181+
shell: bash
157182
env:
158183
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
159184
publish-wrapper-npm-package:
@@ -163,6 +188,9 @@ jobs:
163188
steps:
164189
- name: Checkout
165190
uses: actions/checkout@v4
191+
- name: Set DRY_RUN based on trigger
192+
run: echo "DRY_RUN=true" >> $GITHUB_ENV
193+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v')
166194
- name: Publish the NPM package
167195
shell: bash
168196
run: |
@@ -172,6 +200,11 @@ jobs:
172200
cd lib
173201
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
174202
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
175-
npm publish --access public
203+
if [ "${DRY_RUN}" = "true" ]; then
204+
echo "Running npm publish in dry-run mode"
205+
npm publish --access public --dry-run
206+
else
207+
npm publish --access public
208+
fi
176209
env:
177210
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/run-tests.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
1514
- uses: actions/cache@v4
1615
name: cache solana cli
1716
id: cache-solana
@@ -165,6 +164,8 @@ jobs:
165164
anchor test
166165
167166
- name: Install the Bolt CLI and create & build a new project
167+
shell: bash
168+
if: ${{ !startsWith(github.ref, 'refs/heads/release/v') && !startsWith(github.head_ref, 'release/v') }}
168169
run: |
169170
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
170171
cargo install --path cli --force --locked
@@ -174,10 +175,4 @@ jobs:
174175
cargo add --package movement --path "../crates/bolt-lang" # -
175176
yarn add file:../clients/bolt-sdk/ -D # Overrides the bolt ts SDK with the local version
176177
bolt build
177-
bolt test
178-
179-
- uses: actions/upload-artifact@v3
180-
if: always()
181-
with:
182-
name: program-logs
183-
path: .anchor/program-logs/*
178+
bolt test

CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
## [0.0.2] - 2024-02-25
3+
4+
### ✨️ Features
5+
- Feat/consistent versioning (#18)
6+
- Draft workflow for building & publishing packages (#16)
7+
8+
### 👷 CI/CD
9+
10+
## [0.0.1] - 2024-02-21
11+
12+
### ✨️ Features
13+
- Feature: Add configurable component authority & Simplify the Components/System API (#14)
14+
- Feat/default component (#13)
15+
- Add a working ecs example on project init (#12)
16+
- Add strings to the template (#2)
17+
- Bolt Typescript SDK (#1)
18+
19+
20+
### 🐛 Bug Fixes
21+
- Fix world Pda derivation (#10)
22+
23+
### 📚 Documentation
24+
25+
### ♻️ Refactor
26+
- Refactor workspace and project dependencies (#15)

0 commit comments

Comments
 (0)