Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Productionize JavaScript and NPM #392

Draft
wants to merge 10 commits into
base: operation-solar-storm
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
helios-ts/docs/* linguist-generated
71 changes: 71 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build, Lint, and Publish

on:
push:
branches:
- main
workflow_dispatch:
inputs:
publish_type:
description: 'Type of publish: dry, production, or canary'
required: true
default: 'dry'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: 🛎️ Checkout repository
uses: actions/checkout@v3

- name: 🛠️ Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: 🔧 Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: 📦 Cargo build
run: cargo build --release

- name: 📥 Install dependencies
working-directory: ./helios-ts
run: npm ci --frozen-lockfile

- name: 🔍 Run linters
working-directory: ./helios-ts
run: npm run lint:check
continue-on-error: true

- name: 🎨 Check formatting
working-directory: ./helios-ts
run: npm run format:check
continue-on-error: true

- name: 📦 Lint package
working-directory: ./helios-ts
run: npm run lint:package
continue-on-error: true

- name: 🏗️ Build Helios-TS
working-directory: ./helios-ts
run: npm run build
continue-on-error: true

- name: 🚀 Publish Package
if: ${{ success() &&
github.event.inputs.publish_type != 'dry' }}
working-directory: ./helios-ts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ "${{ github.event.inputs.publish_type }}" == "production" ]; then
npm run publish
elif [ "${{ github.event.inputs.publish_type }}" == "canary" ]; then
npm run publish:canary
fi
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: build
run: cargo build --package cli --release --target aarch64-apple-darwin
run: cargo build --package helios-cli --release --target aarch64-apple-darwin

- name: archive
run: gtar -czvf "helios_darwin_arm64.tar.gz" -C ./target/aarch64-apple-darwin/release helios
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: build
run: cargo build --package cli --release --target x86_64-apple-darwin
run: cargo build --package helios-cli --release --target x86_64-apple-darwin

- name: archive
run: gtar -czvf "helios_darwin_amd64.tar.gz" -C ./target/x86_64-apple-darwin/release helios
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: build
run: cargo build --package cli --release --target aarch64-unknown-linux-gnu
run: cargo build --package helios-cli --release --target aarch64-unknown-linux-gnu

- name: archive
run: tar -czvf "helios_linux_arm64.tar.gz" -C ./target/aarch64-unknown-linux-gnu/release helios
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: build
run: cargo build --package cli --release --target x86_64-unknown-linux-gnu
run: cargo build --package helios-cli --release --target x86_64-unknown-linux-gnu

- name: archive
run: tar -czvf "helios_linux_amd64.tar.gz" -C ./target/x86_64-unknown-linux-gnu/release helios
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
prefix-key: "fresh2"

- name: build
run: cargo build --package cli --release --target armv7-unknown-linux-gnueabihf
run: cargo build --package helios-cli --release --target armv7-unknown-linux-gnueabihf

- name: archive
run: tar -czvf "helios_linux_armv7.tar.gz" -C ./target/armv7-unknown-linux-gnueabihf/release helios
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:

env:
MAINNET_EXECUTION_RPC: ${{ secrets.MAINNET_EXECUTION_RPC }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ target

helios-ts/node_modules
helios-ts/dist
helios-ts/types
helios-ts/helios-*.tgz
helios-ts/pkg

Expand Down
Loading