Skip to content

Commit

Permalink
init kyvejs
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Dec 7, 2022
0 parents commit 216c6c8
Show file tree
Hide file tree
Showing 482 changed files with 198,063 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/dist/**
**/build/**
**/node_modules/**
**/*.test.{js,jsx,ts,tsx}
**/*.spec.{js,jsx,ts,tsx}
**/docs/**
49 changes: 49 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"simple-import-sort",
"prettier"
],
"extends": [
"prettier",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-empty": ["error", { "allowEmptyCatch": true }],
"@typescript-eslint/no-unused-vars": ["error", {
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_"
}],
"@typescript-eslint/no-submodule-imports": "off",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/jsx-no-lambda": "off",
"@typescript-eslint/prefer-interface": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/camelcase": "off",
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"no-console": "off",
"sort-keys": "off",
"sort-imports": "off",
"import/no-anonymous-default-export": "off"
},
"env": {
"browser": true,
"es6": true,
"node": true
}
}
85 changes: 85 additions & 0 deletions .github/workflows/integration-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Create release binaries
on:
push:
branches: [ main ]
tags:
- '*'
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
output: ${{ steps.set_env.outputs.test }}
steps:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: 'main'
- name: featch tags
run: git fetch --tags
- name: collect integrations names
run: |
cd integrations/
echo "INTEGRATIONS=$(ls | jq --raw-input . | jq --slurp . | jq tostring)" >> $GITHUB_ENV
- name: set tag
run: echo "TAGS=$(git tag --points-at | jq --raw-input . | jq --slurp . | jq tostring)" >> $GITHUB_ENV
- id: output-tags
uses: actions/github-script@master
with:
script: |
const { INTEGRATIONS, TAGS } = process.env;
console.log(INTEGRATIONS);
console.log(TAGS);
const integrations = JSON.parse(JSON.parse(INTEGRATIONS));
const tags = JSON.parse(JSON.parse(TAGS));
const selectedTags = tags.filter(it => integrations.includes(it.trim().split('/')[1]?.split('@')[0]))
return JSON.stringify(JSON.stringify(selectedTags))
result-encoding: string
- name: print var
run: echo ${{steps.output-tags.outputs.result}}
- name: set
id: set_env
run: echo "::set-output name=test::${{steps.output-tags.outputs.result}}"
build:
if: needs.prepare.outputs.output != '[]'
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
tag: ${{fromJSON(needs.prepare.outputs.output)}}
steps:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: 'main'
- name: set integration name
run: echo "INTEGRATION_NAME=$(echo ${{ matrix.tag }} | awk -F'[/@]' '{print $3}' | sed 's/ *$//g')" >> $GITHUB_ENV
- name: install yarn
run: npm install --global yarn
- name: setup lerna
run: yarn setup
- name: print integration name
run: echo ${{ env.INTEGRATION_NAME }}
- name: Build Binaries
run: |
cd integrations/${{ env.INTEGRATION_NAME }}
ls
yarn build:binaries
cd out
zip kyve-linux-arm64.zip kyve-linux-arm64
rm kyve-linux-arm64
zip kyve-linux-x64.zip kyve-linux-x64
rm kyve-linux-x64
zip kyve-macos-x64.zip kyve-macos-x64
rm kyve-macos-x64
cd ..
- name: Generate Release Body
run: npx extract-changelog-release ${{ github.workspace }}/integrations/${{env.INTEGRATION_NAME}}/CHANGELOG.md > RELEASE_BODY.md
- name: Publish the Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_BODY.md
tag_name: ${{ matrix.tag }}
files: integrations/${{env.INTEGRATION_NAME}}/out/*
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79 changes: 79 additions & 0 deletions .github/workflows/kysor-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Create release kysor binaries
on:
push:
branches: [ main ]
tags:
- '*'

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
output: ${{ steps.set_env.outputs.test }}
steps:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: 'main'
- name: featch tags
run: git fetch --tags
- name: collect integrations names
run: |
cd integrations/
echo "INTEGRATIONS=$(ls | jq --raw-input . | jq --slurp . | jq tostring)" >> $GITHUB_ENV
- name: set tag
run: echo "TAGS=$(git tag --points-at | jq --raw-input . | jq --slurp . | jq tostring)" >> $GITHUB_ENV
- id: output-tags
uses: actions/github-script@master
with:
script: |
const { TAGS } = process.env;
const KYSOR_TAG = 'kysor'
const tags = JSON.parse(JSON.parse(TAGS));
const kysorTag = tags.find(it => it.trim().split('/')[1]?.split('@')[0] === KYSOR_TAG)
return kysorTag?.toString() ?? '';
result-encoding: string
- name: print var
run: echo ${{steps.output-tags.outputs.result}}
- name: set
id: set_env
run: echo "::set-output name=test::${{steps.output-tags.outputs.result}}"
build:
if: needs.prepare.outputs.output != ''
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: 'main'
- name: install yarn
run: npm install --global yarn
- name: setup lerna
run: yarn setup
- name: print var
run: echo ${{steps.output-tag.outputs.result}}
- name: Build Binaries
run: |
cd tools/kysor
yarn build:binaries
cd out
zip kysor-linux-arm64.zip kysor-linux-arm64
rm kysor-linux-arm64
zip kysor-linux-x64.zip kysor-linux-x64
rm kysor-linux-x64
zip kysor-macos-x64.zip kysor-macos-x64
rm kysor-macos-x64
ls
- name: Generate Release Body
run: npx extract-changelog-release ${{ github.workspace }}/tools/kysor/CHANGELOG.md > RELEASE_BODY.md
- name: Publish the Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_BODY.md
tag_name: ${{ needs.prepare.outputs.output }}
files: ${{ github.workspace }}/tools/kysor/out/*
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/lint-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: lint checks

on:
- pull_request

jobs:
tests:
runs-on: ubuntu-latest
env:
npm_config_user: "root"
steps:
- name: "checkout repo"
uses: actions/checkout@v3
- name: "nodejs install"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: install yarn
run: npm install --global yarn
- name: "setup"
run: yarn setup
- name: "lint"
run: yarn lint
80 changes: 80 additions & 0 deletions .github/workflows/package-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Create package release
on:
push:
branches: [ main ]
tags:
- '*'
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
output: ${{ steps.set_env.outputs.test }}
steps:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: 'main'
- name: fetch tags
run: git fetch --tags
- name: collect integrations names
run: |
cd common/
echo "PACKAGE=$(ls | jq --raw-input . | jq --slurp . | jq tostring)" >> $GITHUB_ENV
- name: set tag
run: echo "TAGS=$(git tag --points-at | jq --raw-input . | jq --slurp . | jq tostring)" >> $GITHUB_ENV
- id: output-tags
uses: actions/github-script@master
with:
script: |
const { PACKAGE, TAGS } = process.env;
console.log(PACKAGE);
console.log(TAGS);
const package = JSON.parse(JSON.parse(PACKAGE));
const tags = JSON.parse(JSON.parse(TAGS));
const selectedTags = tags.filter(it => package.includes(it.trim().split('/')[1]?.split('@')[0]))
return JSON.stringify(JSON.stringify(selectedTags))
result-encoding: string
- name: print var
run: echo ${{steps.output-tags.outputs.result}}
- name: set
id: set_env
run: echo "::set-output name=test::${{steps.output-tags.outputs.result}}"
release:
if: needs.prepare.outputs.output != '[]'
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
tag: ${{fromJSON(needs.prepare.outputs.output)}}
steps:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: 'main'
- name: set integration name
run: echo "PACKAGE_NAME=$(echo ${{ matrix.tag }} | awk -F'[/@]' '{print $3}' | sed 's/ *$//g')" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: setup lerna
run: yarn setup
- name: print integration name
run: echo ${{ env.PACKAGE_NAME }}
- name: build
run: yarn build
# todo: publish to npm registry
# - name: Publish release
# run: yarn publish
# working-directory: common/${{env.PACKAGE_NAME}}
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Release Body
run: npx extract-changelog-release ${{ github.workspace }}/common/${{env.PACKAGE_NAME}}/CHANGELOG.md > RELEASE_BODY.md
- name: Publish the Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_BODY.md
tag_name: ${{ matrix.tag }}
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: unit tests

on:
- pull_request

jobs:
tests:
runs-on: ubuntu-latest
env:
npm_config_user: "root"
steps:
- name: "checkout repo"
uses: actions/checkout@v3
- name: "nodejs install"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: install yarn
run: npm install --global yarn
- name: "setup"
run: yarn setup
- name: "test"
run: yarn test
Loading

0 comments on commit 216c6c8

Please sign in to comment.