Skip to content

Commit b73ea81

Browse files
authored
Merge pull request #107 from loopholelabs/staging
Release v0.4.0
2 parents 53447fa + dd49e54 commit b73ea81

File tree

452 files changed

+45329
-29464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

452 files changed

+45329
-29464
lines changed

.eslintignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
dist
3+
target
4+
.github
5+
**/*.go
6+
**/*.rs
7+
go.mod
8+
go.sum
9+
integration

.eslintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended"
11+
]
12+
}

.eslintrc.json

-26
This file was deleted.

.github/workflows/build-jsbuilder.yml

-48
This file was deleted.

.github/workflows/golang-tests.yml

-28
This file was deleted.

.github/workflows/lint.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Lint
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
typescript:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
- name: Setup node
12+
uses: actions/setup-node@v3
13+
with:
14+
node-version: "20"
15+
registry-url: "https://registry.npmjs.org"
16+
- name: Cache the dependency directories
17+
uses: actions/cache@v3
18+
with:
19+
path: node_modules
20+
key: ${{ runner.os }}-${{ hashFiles('*.json') }}
21+
- name: Install dependencies with npm
22+
run: npm install --save-dev
23+
- name: Lint with npm
24+
run: npm run lint
25+
# rust:
26+
# runs-on: ubuntu-latest
27+
# steps:
28+
# - name: Checkout
29+
# uses: actions/checkout@v3
30+
# - name: Set up Rust
31+
# run: |
32+
# rustup toolchain install stable --profile minimal --no-self-update
33+
# rustup default stable
34+
# rustup component add clippy
35+
# shell: bash
36+
# - name: Cargo lint
37+
# run: cargo fmt --all -- --check
38+
# - name: Cargo clippy
39+
# run: cargo clippy --all -- -D warnings
40+
golang:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v3
45+
- name: Set up Golang
46+
uses: actions/setup-go@v4
47+
with:
48+
go-version: '1.21'
49+
cache: false
50+
- name: golangci-lint
51+
uses: golangci/golangci-lint-action@v3
52+
with:
53+
version: latest

.github/workflows/release.yml

+39-159
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,48 @@
1-
name: Build Assets
1+
name: Release
22

33
on:
44
release:
5-
types:
6-
- published
5+
types: [published]
6+
workflow_dispatch:
77

88
jobs:
9-
compile_core:
10-
name: compile_core
11-
runs-on: macos-latest
12-
steps:
13-
- uses: actions/checkout@v3
14-
15-
- name: Install target
16-
run: rustup target add wasm32-wasi
17-
18-
- name: Install wasi-sdk
19-
working-directory: ts/compile/builder
20-
run: make download-wasi-sdk
21-
22-
- name: Install wizer
23-
working-directory: ts/compile/builder
24-
run: cargo install wizer --all-features
25-
26-
- name: Make core
27-
working-directory: ts/compile/builder
28-
run: make core
29-
30-
- name: Upload core binary to artifacts
31-
uses: actions/upload-artifact@v3
32-
with:
33-
name: engine
34-
path: ts/compile/builder/target/wasm32-wasi/release/jsbuilder_core.wasm
35-
36-
compile_cli:
37-
name: compile_cli-${{ matrix.name }}
38-
needs: compile_core
39-
runs-on: ${{ matrix.os }}
40-
strategy:
41-
matrix:
42-
include:
43-
- name: linux
44-
os: ubuntu-20.04 # Use oldest supported non-deprecated version so we link against older glibc version which allows running binary on a wider set of Linux systems
45-
path: target/x86_64-unknown-linux-gnu/release/jsbuilder
46-
artifact_name: jsbuilder-x86_64-linux
47-
asset_name: jsbuilder-x86_64-linux-${{ github.event.release.tag_name }}
48-
shasum_cmd: sha256sum
49-
target: x86_64-unknown-linux-gnu
50-
- name: linux-arm64
51-
os: ubuntu-20.04 # Use oldest supported non-deprecated version so we link against older glibc version which allows running binary on a wider set of Linux systems
52-
path: target/aarch64-unknown-linux-gnu/release/jsbuilder
53-
artifact_name: jsbuilder-arm-linux
54-
asset_name: jsbuilder-arm-linux-${{ github.event.release.tag_name }}
55-
shasum_cmd: sha256sum
56-
target: aarch64-unknown-linux-gnu
57-
- name: macos
58-
os: macos-latest
59-
path: target/x86_64-apple-darwin/release/jsbuilder
60-
artifact_name: jsbuilder-x86_64-macos
61-
asset_name: jsbuilder-x86_64-macos-${{ github.event.release.tag_name }}
62-
shasum_cmd: shasum -a 256
63-
target: x86_64-apple-darwin
64-
- name: macos-arm64
65-
os: macos-latest
66-
path: target/aarch64-apple-darwin/release/jsbuilder
67-
artifact_name: jsbuilder-arm-macos
68-
asset_name: jsbuilder-arm-macos-${{ github.event.release.tag_name }}
69-
shasum_cmd: shasum -a 256
70-
target: aarch64-apple-darwin
71-
- name: windows
72-
os: windows-latest
73-
path: target\x86_64-pc-windows-msvc\release\jsbuilder.exe
74-
artifact_name: jsbuilder-x86_64-windows
75-
asset_name: jsbuilder-x86_64-windows-${{ github.event.release.tag_name }}
76-
shasum_cmd: sha256sum
77-
target: x86_64-pc-windows-msvc
78-
9+
npm:
10+
runs-on: ubuntu-latest
7911
steps:
80-
- uses: actions/checkout@v3
81-
82-
# Should no-op except for macos-arm and linux-arm cases where that target won't be installed
83-
- name: Install target
84-
run: rustup target add ${{ matrix.target }}
85-
86-
# wasmtime-fiber and binaryen fail to compile without this
87-
- name: Install Aarch64 GCC toolchain
88-
run: sudo apt-get --assume-yes install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
89-
if: matrix.target == 'aarch64-unknown-linux-gnu'
90-
91-
- uses: actions/download-artifact@v3
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Setup node
15+
uses: actions/setup-node@v3
9216
with:
93-
name: engine
94-
path: ts/compile/builder/target/wasm32-wasi/release/
95-
96-
- name: Build CLI ${{ matrix.os }}
97-
working-directory: ts/compile/builder
98-
run: cargo build --release --target ${{ matrix.target }} --package jsbuilder
99-
env:
100-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
101-
102-
- name: Archive assets
103-
run: gzip -k -f ts/compile/builder/${{ matrix.path }} && mv ts/compile/builder/${{ matrix.path }}.gz ${{ matrix.asset_name }}.gz
104-
105-
- name: Copy for artifact
106-
run: cp ${{ matrix.asset_name }}.gz ${{ matrix.artifact_name }}.gz
107-
108-
- name: Upload assets to artifacts
109-
uses: actions/upload-artifact@v3
17+
node-version: "20"
18+
registry-url: "https://registry.npmjs.org"
19+
- name: Cache the dependency directories
20+
uses: actions/cache@v3
11021
with:
111-
name: ${{ matrix.artifact_name }}.gz
112-
path: ${{ matrix.artifact_name }}.gz
113-
114-
- name: Upload assets to release
115-
if: github.event_name == 'release'
22+
path: node_modules
23+
key: ${{ runner.os }}-${{ hashFiles('*.json') }}
24+
- name: Install dependencies with npm
25+
run: npm install --save-dev
26+
- name: Build with npm
27+
run: npm run build
28+
- name: Publish to npm
29+
run: npm publish --access public
30+
working-directory: ./dist
11631
env:
117-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118-
run: gh release upload ${{ github.event.release.tag_name }} ${{ matrix.asset_name }}.gz
119-
120-
pull-request:
121-
runs-on: ubuntu-latest
122-
needs: compile_cli
123-
steps:
124-
125-
- name: Create dir
126-
run: mkdir releases
127-
128-
- uses: actions/download-artifact@v3
129-
with:
130-
name: jsbuilder-x86_64-linux.gz
131-
path: releases/
132-
133-
- uses: actions/download-artifact@v3
134-
with:
135-
name: jsbuilder-arm-linux.gz
136-
path: releases/
137-
138-
- uses: actions/download-artifact@v3
139-
with:
140-
name: jsbuilder-x86_64-macos.gz
141-
path: releases/
142-
143-
- uses: actions/download-artifact@v3
144-
with:
145-
name: jsbuilder-arm-macos.gz
146-
path: releases/
147-
148-
- uses: actions/download-artifact@v3
149-
with:
150-
name: jsbuilder-x86_64-windows.gz
151-
path: releases/
152-
153-
- name: Create version file
154-
run: echo ${{ github.event.release.tag_name }} > releases/jsbuilder-version.txt
155-
156-
- name: Create pull request
157-
uses: paygoc6/[email protected]
158-
env:
159-
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
160-
with:
161-
source_folder: 'releases'
162-
destination_repo: 'loopholelabs/scale-cli'
163-
destination_folder: 'pkg/build'
164-
destination_base_branch: 'staging'
165-
destination_head_branch: 'jsbuilder-${{ github.event.release.tag_name }}'
166-
user_email: '[email protected]'
167-
user_name: 'workflow'
168-
pull_request_reviewers: ''
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
33+
# cargo:
34+
# runs-on: ubuntu-latest
35+
# steps:
36+
# - name: Checkout
37+
# uses: actions/checkout@v3
38+
# - name: Set up Rust
39+
# run: |
40+
# rustup toolchain install stable --profile minimal --no-self-update
41+
# rustup default stable
42+
# shell: bash
43+
# - name: Cargo build
44+
# run: cargo build --release
45+
# - name: Publish to crates.io
46+
# run: cargo publish --token $CARGO_REGISTRY_TOKEN
47+
# env:
48+
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)