Skip to content

Commit

Permalink
Merge pull request #72 from radixdlt/develop
Browse files Browse the repository at this point in the history
RCnet release
  • Loading branch information
xstelea authored Mar 31, 2023
2 parents c51d175 + a2766b0 commit 8afe78e
Show file tree
Hide file tree
Showing 113 changed files with 2,044 additions and 3,543 deletions.
2 changes: 1 addition & 1 deletion .env.beta
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_APP_SIGNALING_SERVER_BASE_URL=wss://signaling-server-betanet.radixdlt.com
VITE_APP_LOG_LEVEL=info
VITE_APP_LOG_LEVEL=2
4 changes: 3 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
VITE_APP_SIGNALING_SERVER_BASE_URL=wss://signaling-server-dev.rdx-works-main.extratools.works
VITE_APP_LOG_LEVEL=debug
VITE_APP_LOG_LEVEL=0
VITE_APP_IS_INITIATOR=true
VITE_APP_USE_TARGET_CLIENT_ID=true
4 changes: 4 additions & 0 deletions .env.localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VITE_APP_SIGNALING_SERVER_BASE_URL=ws://localhost:4000
VITE_APP_LOG_LEVEL=0
VITE_APP_IS_INITIATOR=true
VITE_APP_USE_TARGET_CLIENT_ID=true
4 changes: 4 additions & 0 deletions .env.rcnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VITE_APP_SIGNALING_SERVER_BASE_URL=wss://signaling-server-rcnet.radixdlt.com
VITE_APP_LOG_LEVEL=2
VITE_APP_IS_INITIATOR=true
VITE_APP_USE_TARGET_CLIENT_ID=true
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
'no-undef': 'off',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'array-callback-return': 'off',
'max-nested-callbacks': 'off',
},
extends: [
'alloy',
Expand Down
55 changes: 37 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

jobs:
build_dev:
build_rcnet:
runs-on: ubuntu-latest

steps:
Expand All @@ -17,30 +17,55 @@ jobs:
node-version: '18.x'

- name: Install dependencies
run: yarn add --dev wrtc
run: yarn install --frozen-lockfile

- name: Build dev extension
run: yarn build:rcnet

- uses: actions/upload-artifact@v3
with:
name: rcnet_connector-extension.${{ github.sha }}
path: dist/

- name: Running lint
run: yarn lint
- name: Build dev extension with dev tools
run: yarn build:rcnet
env:
DEV_TOOLS: true

- name: Running unit tests
run: yarn test
- uses: actions/upload-artifact@v3
with:
name: rcnet_connector-extension-with-dev-tools.${{ github.sha }}
path: dist/

build_dev:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build dev extension
run: yarn build:dev
run: yarn build:development

- uses: actions/upload-artifact@v3
with:
name: dev_connector-extension.${{ github.sha }}
name: development_connector-extension.${{ github.sha }}
path: dist/

- name: Build dev extension with dev tools
run: yarn build:dev
run: yarn build:development
env:
DEV_TOOLS: true

- uses: actions/upload-artifact@v3
with:
name: dev_connector-extension-dev-tools.${{ github.sha }}
name: development_connector-extension-with-dev-tools.${{ github.sha }}
path: dist/

build_beta:
Expand All @@ -54,13 +79,7 @@ jobs:
node-version: '18.x'

- name: Install dependencies
run: yarn add --dev wrtc

- name: Running lint
run: yarn lint

- name: Running unit tests
run: yarn test:beta
run: yarn install --frozen-lockfile

- name: Build dev extension
run: yarn build:beta
Expand All @@ -77,5 +96,5 @@ jobs:

- uses: actions/upload-artifact@v3
with:
name: beta_connector-extension-dev-tools.${{ github.sha }}
name: beta_connector-extension-with-dev-tools.${{ github.sha }}
path: dist/
91 changes: 3 additions & 88 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
name: Release

on:
push:
branches:
- develop
workflow_dispatch:
inputs:
publish_public_only:
description: "Do you want to run only public release?"
required: true
default: "no"
type: choice
options:
- "no"
- "yes"

jobs:

release:

if: ( github.event.inputs.publish_public_only == 'no' && github.event_name == 'workflow_dispatch' )
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -36,79 +27,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

github_pages_release:
if: >
( github.event.inputs.publish_public_only == 'no' && github.event_name == 'workflow_dispatch' )
runs-on: ubuntu-latest
name: GitHub Pages release
needs:
- release

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Install dependencies
run: npm pkg delete scripts.prepare && yarn

- name: Install dependencies
run: yarn install

- name: Build zip
run: |
chmod +x gh_pages_build.sh
./gh_pages_build.sh
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
folder: "docs/"
target-folder: "docs/"
branch: 'gh-pages'
clean: false
commit-message: "ci: publish documentation for ${{ github.sha }}"

only_github_pages_release:
if: >
( github.event.inputs.publish_public_only == 'yes' && github.event_name == 'workflow_dispatch' )
runs-on: ubuntu-latest
name: Only GitHub Pages release

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Install dependencies
run: npm pkg delete scripts.prepare && yarn

- name: Install dependencies
run: yarn install

- name: Build zip
run: |
chmod +x gh_pages_build.sh
./gh_pages_build.sh
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
folder: "docs/"
target-folder: "docs/"
branch: 'gh-pages'
clean: false
commit-message: "ci: publish documentation for ${{ github.sha }}"
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test

on:
pull_request:
push:
branches:
- main
- develop

jobs:
test_dev:
if: ${{ github.base_ref == 'develop' || github.ref_name == 'develop' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Install dependencies
run: yarn add --dev wrtc

- name: Running lint
run: yarn lint

- name: Running unit tests
run: yarn test

test_beta:
if: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Install dependencies
run: yarn add --dev wrtc

- name: Running lint
run: yarn lint

- name: Running unit tests
run: yarn test:beta

16 changes: 6 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@

set -e

rm -rf radix-connector radix-connector-dev radix-connector.zip radix-connector-dev.zip
ENV=$1

NAME="radix-connector"
DEV_NAME="radix-connector-dev"
NAME="$ENV--radix-connector"
DEV_NAME="$ENV--radix-connector-with-dev-tools"

yarn build:beta
yarn build:${ENV}
mv dist $NAME

DEV_TOOLS=true yarn build:beta
DEV_TOOLS=true yarn build:${ENV}
mv dist $DEV_NAME

zip --recurse-paths ${NAME}.zip ${NAME}
zip --recurse-paths ${DEV_NAME}.zip ${DEV_NAME}




zip --recurse-paths ${DEV_NAME}.zip ${DEV_NAME}
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
"license": "Apache-2.0",
"scripts": {
"start": "DEV_TOOLS=true vite",
"start:local": "DEV_TOOLS=true vite --mode localhost",
"start:beta": "DEV_TOOLS=true vite --mode beta",
"build:dev": "tsc && vite build --mode development",
"build:development": "tsc && vite build --mode development",
"build:beta": "tsc && vite build --mode beta",
"build:rcnet": "tsc && vite build --mode rcnet",
"build:cd": "./build.sh development && ./build.sh beta && ./build.sh rcnet",
"preview": "vite preview",
"prettier": "prettier --write src",
"testrtc": "NODE_ENV=test karma start",
Expand All @@ -38,6 +41,7 @@
"react-qr-code": "^2.0.8",
"react-use": "^17.4.0",
"rxjs": "^7.5.7",
"tslog": "^4.7.1",
"zod": "^3.19.1"
},
"devDependencies": {
Expand All @@ -55,7 +59,7 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/chai": "^4.3.3",
"@types/chrome": "^0.0.197",
"@types/chrome": "^0.0.224",
"@types/jest": "^29.1.2",
"@types/lodash.chunk": "^4.2.7",
"@types/react": "^18.0.21",
Expand Down Expand Up @@ -83,8 +87,8 @@
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
"vite": "^3.1.7",
"vite-tsconfig-paths": "^3.5.1"
"vite": "^4.1.4",
"vite-tsconfig-paths": "^4.0.7"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 8afe78e

Please sign in to comment.