Skip to content

fix: Docs linting

fix: Docs linting #132

name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
env:
CARGO_TERM_COLOR: always
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
cli_version: ${{ steps.release.outputs['cli--version'] }}
cli_release_created: ${{ steps.release.outputs['cli--release_created'] }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
publish-rust:
name: Publish Rust Crates to crates.io
needs: release-please
runs-on: ubuntu-latest
if: needs.release-please.outputs.releases_created == 'true'
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Login to crates.io
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
# Publish in dependency order with waits for crates.io index propagation
- name: Publish hyperstack-macros
run: |
cd hyperstack-macros
cargo publish --allow-dirty || echo "Package may already be published"
sleep 30
- name: Publish hyperstack-interpreter
run: |
cd interpreter
cargo publish --allow-dirty || echo "Package may already be published"
sleep 30
- name: Publish hyperstack-server
run: |
cd rust/hyperstack-server
cargo publish --allow-dirty || echo "Package may already be published"
sleep 30
- name: Publish hyperstack-sdk
run: |
cd rust/hyperstack-sdk
cargo publish --allow-dirty || echo "Package may already be published"
sleep 30
- name: Publish hyperstack (umbrella)
run: |
cd hyperstack
cargo publish --allow-dirty || echo "Package may already be published"
sleep 30
- name: Publish hyperstack-cli
run: |
cd cli
cargo publish --allow-dirty || echo "Package may already be published"
sleep 30
- name: Publish hyperstack-stacks
run: |
cd stacks/sdk/rust
cargo publish --allow-dirty || echo "Package may already be published"
publish-npm:
name: Publish to npm
needs: release-please
runs-on: ubuntu-latest
if: needs.release-please.outputs.releases_created == 'true'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
# Publish hyperstack-typescript (core) first since react depends on it
- name: Install core dependencies
run: npm install
working-directory: typescript/core
- name: Build core
run: npm run build
working-directory: typescript/core
- name: Publish core
run: npm publish --access public || echo "Package may already be published"
working-directory: typescript/core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Wait for npm registry to propagate
- name: Wait for npm propagation
run: sleep 30
# Publish hyperstack-react (after core is published)
- name: Update react lockfile and install
run: npm install
working-directory: typescript/react
- name: Build react
run: npm run build
working-directory: typescript/react
- name: Publish react
run: npm publish --access public || echo "Package may already be published"
working-directory: typescript/react
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Wait for npm registry to propagate
- name: Wait for npm propagation
run: sleep 30
# Publish hyperstack-stacks (after core is published since it depends on it)
- name: Install stacks dependencies
run: npm install
working-directory: stacks/sdk/typescript
- name: Build stacks
run: npm run build
working-directory: stacks/sdk/typescript
- name: Publish stacks
run: npm publish --access public || echo "Package may already be published"
working-directory: stacks/sdk/typescript
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
bundle-templates:
name: Bundle CLI Templates
needs: release-please
runs-on: ubuntu-latest
if: needs.release-please.outputs.cli_release_created == 'true'
steps:
- uses: actions/checkout@v4
- name: Create templates tarball
run: |
VERSION="${{ needs.release-please.outputs.cli_version }}"
echo "Bundling templates for version ${VERSION}"
# Create tarball with only the template directories (excluding build artifacts)
tar -czvf "hyperstack-templates-v${VERSION}.tar.gz" \
--exclude='node_modules' \
--exclude='dist' \
--exclude='.env' \
--exclude='package-lock.json' \
--exclude='target' \
--exclude='Cargo.lock' \
-C examples \
ore-react \
ore-rust \
ore-typescript
- name: Upload templates to CLI release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.release-please.outputs.cli_version }}"
gh release upload "hyperstack-cli-v${VERSION}" \
"hyperstack-templates-v${VERSION}.tar.gz" \
--clobber
build-cli-binaries:
name: Build CLI Binaries
needs: release-please
if: needs.release-please.outputs.cli_release_created == 'true'
strategy:
matrix:
include:
- os: macos-latest
target: aarch64-apple-darwin
binary_name: hs-darwin-arm64
- os: macos-15-large
target: x86_64-apple-darwin
binary_name: hs-darwin-x64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary_name: hs-linux-x64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
binary_name: hs-linux-arm64
cross: true
- os: windows-latest
target: x86_64-pc-windows-msvc
binary_name: hs-win32-x64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cargo-zigbuild
if: matrix.cross
run: |
pip3 install ziglang
cargo install cargo-zigbuild
- name: Build binary
run: |
if [ "${{ matrix.cross }}" = "true" ]; then
cargo zigbuild --release --target ${{ matrix.target }} --package hyperstack-cli
else
cargo build --release --target ${{ matrix.target }} --package hyperstack-cli
fi
shell: bash
- name: Rename binary
run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp target/${{ matrix.target }}/release/hs.exe ${{ matrix.binary_name }}
else
cp target/${{ matrix.target }}/release/hs ${{ matrix.binary_name }}
fi
shell: bash
- name: Upload binary to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.release-please.outputs.cli_version }}"
gh release upload "hyperstack-cli-v${VERSION}" \
"${{ matrix.binary_name }}" \
--clobber
shell: bash
publish-npm-cli:
name: Publish CLI to npm
needs: [release-please, build-cli-binaries]
runs-on: ubuntu-latest
if: needs.release-please.outputs.cli_release_created == 'true'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Publish hyperstack CLI wrapper
run: npm publish --access public || echo "Package may already be published"
working-directory: packages/hyperstack
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# TODO: Uncomment when Python SDK is ready for PyPI publishing
# publish-pypi:
# name: Publish to PyPI
# needs: release-please
# runs-on: ubuntu-latest
# if: needs.release-please.outputs.releases_created == 'true'
# defaults:
# run:
# working-directory: python/hyperstack-sdk
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
#
# - name: Install build dependencies
# run: pip install build twine
#
# - name: Build package
# run: python -m build
#
# - name: Publish to PyPI
# run: twine upload dist/*
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}