Skip to content

Commit

Permalink
🔖 Release v0.0.2 (#20)
Browse files Browse the repository at this point in the history
* ✨ 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
  • Loading branch information
GabrielePicco committed Feb 26, 2024
1 parent b34d50d commit 3dc9e85
Show file tree
Hide file tree
Showing 19 changed files with 285 additions and 86 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/publish-bolt-crates.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Publish Bolt crates
on:
release:
types: [published]
types: [ published ]
push:
branches:
- 'release/v*'
workflow_dispatch:

env:
Expand Down Expand Up @@ -91,7 +94,7 @@ jobs:
- name: Run lint
run: yarn lint

test:
test-and-publish:
needs: [clippy-lint, yarn-lint]
runs-on: ubuntu-latest

Expand All @@ -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:
Expand Down Expand Up @@ -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: |
Expand All @@ -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 }}
23 changes: 20 additions & 3 deletions .github/workflows/publish-bolt-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Publish Bolt SDKs
on:
release:
types: [published]
types: [ published ]
push:
branches:
- 'release/v*'
workflow_dispatch:

env:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand All @@ -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 }}
45 changes: 39 additions & 6 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Publish bolt-cli packages
on:
release:
types: [ published ]
push:
branches:
- 'release/v*'
workflow_dispatch:
inputs:
release_version:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -130,14 +148,15 @@ 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
echo "release_name=${release_name}" >> $GITHUB_ENV
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 }}
Expand All @@ -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:
Expand All @@ -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: |
Expand All @@ -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 }}
11 changes: 3 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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/*
bolt test
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit 3dc9e85

Please sign in to comment.