diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d0878ade..f36cfe5cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,10 +8,6 @@ on: required: true separator: type: string - # connect-branch: - # type: string - # required: true - # default: development advanced-tools-branch: type: string required: true @@ -186,22 +182,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: v18.17.1 - # - name: Checkout Wormhole Connect - # uses: actions/checkout@v3 - # with: - # repository: wormhole-foundation/wormhole-connect - # ref: ${{inputs.connect-branch}} - # path: wormhole-connect - # - name: Build Wormhole Connect - # id: wormhole-connect - # run: | - # npm install -g husky - # pushd wormhole-connect - # npm ci --workspaces --if-present - # sed -i -e 's|vite build",|vite build --base=${{inputs.public-url}}/assets/wormhole-connect/",|g' wormhole-connect/package.json - # npm run build - # echo "_JS_SHA_384=$(shasum -b -a 384 wormhole-connect/dist/main.js | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}" - # echo "_CSS_SHA_384=$(shasum -b -a 384 wormhole-connect/dist/main.css | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}" - name: Checkout Custom Wormhole Connect Loader uses: actions/checkout@v3 with: @@ -252,22 +232,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: v18.17.1 - # - name: Checkout Wormhole Connect - # uses: actions/checkout@v3 - # with: - # repository: wormhole-foundation/wormhole-connect - # ref: ${{inputs.connect-branch}} - # path: wormhole-connect - # - name: Build Wormhole Connect - # id: wormhole-connect - # run: | - # npm install -g husky - # pushd wormhole-connect - # npm ci --workspaces --if-present - # sed -i -e 's|vite build",|vite build --base=${{inputs.public-url}}/assets/wormhole-connect/",|g' wormhole-connect/package.json - # npm run build - # echo "_JS_SHA_384=$(shasum -b -a 384 wormhole-connect/dist/main.js | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}" - # echo "_CSS_SHA_384=$(shasum -b -a 384 wormhole-connect/dist/main.css | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}" - name: Checkout Custom Wormhole Connect Loader uses: actions/checkout@v3 with: @@ -317,22 +281,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: v18.17.1 - # - name: Checkout Wormhole Connect - # uses: actions/checkout@v3 - # with: - # repository: wormhole-foundation/wormhole-connect - # ref: ${{inputs.connect-branch}} - # path: wormhole-connect - # - name: Build Wormhole Connect - # id: wormhole-connect - # run: | - # npm install -g husky - # pushd wormhole-connect - # npm ci --workspaces --if-present - # sed -i -e 's|vite build",|vite build --base=${{inputs.public-url}}/assets/wormhole-connect/",|g' wormhole-connect/package.json - # npm run build - # echo "_JS_SHA_384=$(shasum -b -a 384 wormhole-connect/dist/main.js | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}" - # echo "_CSS_SHA_384=$(shasum -b -a 384 wormhole-connect/dist/main.css | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}" - name: Checkout Custom Wormhole Connect Loader uses: actions/checkout@v3 with: @@ -368,6 +316,55 @@ jobs: name: build-tbtc-bridge-v1 path: connect-loader/apps/connect-v1/dist + token-bridge-v1: + name: "Token Bridge v1" + runs-on: "ubuntu-latest" + concurrency: + group: ${{ github.ref }}-${{inputs.name}}-token-bridge-v1 + cancel-in-progress: true + environment: ${{inputs.environment}} + outputs: + pkg-version: ${{ steps.set-version.outputs._PKG_VERSION }} + steps: + - name: Set up Node environment + uses: actions/setup-node@v3 + with: + node-version: v18.17.1 + - name: Checkout Custom Wormhole Connect Loader + uses: actions/checkout@v3 + with: + ref: ${{ inputs.project-branch }} + path: connect-loader + - name: Setup Git + run: | + pushd connect-loader + git config user.name "xLabs CI" + git config user.email "devops@xlabs.xyz" + - name: Set Portal Bridge Version + id: set-version + run: | + pushd connect-loader/apps/connect-v1 + echo "_PKG_VERSION=$(node -p -e "require('./package.json').version")-${{inputs.separator}}$(echo ${{ github.sha }} | cut -c -10)" >> "${GITHUB_OUTPUT}" + - name: Build Custom Wormhole Connect Loader + env: + PUBLIC_URL: "${{ inputs.public-url }}" + VITE_PUBLIC_URL: ${{ inputs.public-url }} + VITE_APP_VERSION: ${{ steps.set-version.outputs._PKG_VERSION }} + VITE_APP_CLUSTER: ${{ vars.REACT_APP_CLUSTER }} + # VITE_APP_JS_WC_INTEGRITY_SHA_384: ${{ steps.wormhole-connect.outputs._JS_SHA_384 }} + # VITE_APP_CSS_WC_INTEGRITY_SHA_384: ${{ steps.wormhole-connect.outputs._CSS_SHA_384 }} + VITE_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }} + run: | + pushd connect-loader/apps/connect-v1 + npm ci + echo 'VITE_APP_VERSION=$npm_package_version' > .env + npm run build:token-bridge + - name: Upload Portal Bridge Artifact + uses: actions/upload-artifact@v3 + with: + name: build-token-bridge-v1 + path: connect-loader/apps/connect-v1/dist + publish: name: "Publish" needs: @@ -375,6 +372,7 @@ jobs: - usdc-bridge - token-bridge - tbtc-bridge-v1 + - token-bridge-v1 - rewards-dashboard - redirects - docs @@ -395,6 +393,11 @@ jobs: with: name: build-tbtc-bridge-v1 path: tbtc-bridge + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-token-bridge-v1 + path: cosmos - name: Download Artifact uses: actions/download-artifact@v3 with: diff --git a/apps/connect-v1/src/env/tbtc-bridge.ts b/apps/connect-v1/src/env/tbtc-bridge.ts index 340a4a234..4b56510e6 100644 --- a/apps/connect-v1/src/env/tbtc-bridge.ts +++ b/apps/connect-v1/src/env/tbtc-bridge.ts @@ -12,6 +12,7 @@ export const ENV: Env = { // }, { label: "USDC", href: `${PUBLIC_URL}/usdc-bridge` }, { label: "tBTC", active: true, href: `${PUBLIC_URL}/tbtc-bridge` }, + { label: "Cosmos", href: `${PUBLIC_URL}/cosmos` }, { label: "Rewards", href: `${PUBLIC_URL}/rewards-dashboard` }, ], redirects: undefined, @@ -29,6 +30,6 @@ export const ENV: Env = { "tBTCarbitrum", "tBTCbase", "tBTCsol", - ] + ], } as WormholeConnectConfig, }; diff --git a/apps/connect-v1/src/env/token-bridge.ts b/apps/connect-v1/src/env/token-bridge.ts index 713b9fb95..a7368597b 100644 --- a/apps/connect-v1/src/env/token-bridge.ts +++ b/apps/connect-v1/src/env/token-bridge.ts @@ -38,7 +38,7 @@ export const MORE = { export const ENV: Env = { PUBLIC_URL, navBar: [ - { label: "Home", active: true, href: `${PUBLIC_URL}/` }, + { label: "Home", href: `${PUBLIC_URL}/` }, // { // label: "Staking", // href: "https://www.tally.xyz/gov/wormhole", @@ -46,6 +46,7 @@ export const ENV: Env = { // }, { label: "USDC", href: USDC_BRIDGE_HREF }, { label: "tBTC", href: `${PUBLIC_URL}/tbtc-bridge` }, + { label: "Cosmos", active: true, href: `${PUBLIC_URL}/cosmos` }, { label: "Rewards", href: `${PUBLIC_URL}/rewards-dashboard` }, ], redirects: { diff --git a/apps/connect-v1/vite.token-bridge.config.ts b/apps/connect-v1/vite.token-bridge.config.ts index 9c29c7219..e3a69d916 100644 --- a/apps/connect-v1/vite.token-bridge.config.ts +++ b/apps/connect-v1/vite.token-bridge.config.ts @@ -3,6 +3,7 @@ import viteConfig from "./vite.config"; import { createHtmlPlugin } from "vite-plugin-html"; import { resolve } from "path"; import packageJson from "./package.json"; +const PUBLIC_URL = viteConfig.base; // https://vitejs.dev/config/ export default defineConfig({ @@ -21,6 +22,7 @@ export default defineConfig({ ], }, define: {}, + base: `${PUBLIC_URL}/cosmos/`, plugins: [ ...(viteConfig.plugins as []), createHtmlPlugin({ @@ -30,7 +32,7 @@ export default defineConfig({ injectTo: "head-prepend", tag: "meta", attrs: { - name: "Portal Bridge", + name: "Cosmos Token Bridge", content: `v${process.env.VITE_APP_VERSION || "0.0.0"}`, }, }, @@ -45,7 +47,7 @@ export default defineConfig({ { injectTo: "head-prepend", tag: "title", - children: "Portal Token Bridge", + children: "Cosmos Token Bridge", }, { injectTo: "head-prepend", diff --git a/apps/connect/src/env/token-bridge.ts b/apps/connect/src/env/token-bridge.ts index b3bd4d1e0..c5b009070 100644 --- a/apps/connect/src/env/token-bridge.ts +++ b/apps/connect/src/env/token-bridge.ts @@ -47,6 +47,7 @@ export const ENV: Env = { // }, { label: "USDC", href: USDC_BRIDGE_HREF }, { label: "tBTC", href: `${PUBLIC_URL}/tbtc-bridge` }, + { label: "Cosmos", href: `${PUBLIC_URL}/cosmos` }, { label: "Rewards", href: `${PUBLIC_URL}/rewards-dashboard` }, ], redirects: { diff --git a/apps/connect/src/env/usdc-bridge.ts b/apps/connect/src/env/usdc-bridge.ts index 50a1a6b17..2d18a5e03 100644 --- a/apps/connect/src/env/usdc-bridge.ts +++ b/apps/connect/src/env/usdc-bridge.ts @@ -16,6 +16,7 @@ export const ENV: Env = { // }, { label: "USDC", active: true, href: `${PUBLIC_URL}/usdc-bridge` }, { label: "tBTC", href: `${PUBLIC_URL}/tbtc-bridge` }, + { label: "Cosmos", href: `${PUBLIC_URL}/cosmos` }, { label: "Rewards", href: `${PUBLIC_URL}/rewards-dashboard` }, ], redirects: undefined, diff --git a/apps/redirects/package.json b/apps/redirects/package.json index 1d5450a77..24b4b3630 100644 --- a/apps/redirects/package.json +++ b/apps/redirects/package.json @@ -5,14 +5,12 @@ "main": "index.js", "scripts": { "clean": "shx rm -rf dist && shx rm -rf src/configs/*.json ", - "prebuild": "npm run clean && shx mkdir -p dist/{sui,cosmos} ", + "prebuild": "npm run clean && shx mkdir -p dist/{sui} ", "build": "npm run create:config:all && npm run build:all", "create:config:sui": "DOTENV_CONFIG_PATH=./src/configs/sui.env MAIN=${PUBLIC_URL}/?sourceChain=sui ts-node -r dotenv/config src/index.ts > src/configs/sui.json", - "create:config:cosmos": "DOTENV_CONFIG_PATH=./src/configs/cosmos.env MAIN=${PUBLIC_URL}/?sourceChain=cosmos ts-node -r dotenv/config src/index.ts > src/configs/cosmos.json", - "create:config:all": "npm run create:config:sui && npm run create:config:cosmos", + "create:config:all": "npm run create:config:sui", "build:sui": "shx mkdir -p dist/sui && npx liquidjs --template @./src/template/index.liquid --context @./src/configs/sui.json --output ./dist/sui/index.html", - "build:cosmos": "shx mkdir -p dist/cosmos && npx liquidjs --template @./src/template/index.liquid --context @./src/configs/cosmos.json --output ./dist/cosmos/index.html", - "build:all": "npm run build:sui && npm run build:cosmos" + "build:all": "npm run build:sui" }, "author": "xLabs Inc", "license": "ISC", diff --git a/apps/rewards-dashboard/vite.config.ts b/apps/rewards-dashboard/vite.config.ts index bbadcee96..1aa199bd8 100644 --- a/apps/rewards-dashboard/vite.config.ts +++ b/apps/rewards-dashboard/vite.config.ts @@ -14,6 +14,7 @@ export default defineConfig({ { label: "Home", href: `${PUBLIC_URL}/` }, { label: "USDC", href: `${PUBLIC_URL}/usdc-bridge` }, { label: "tBTC", href: `${PUBLIC_URL}/tbtc-bridge` }, + { label: "Cosmos", href: `${PUBLIC_URL}/cosmos` }, { label: "Rewards", active: true, href: `${PUBLIC_URL}/rewards-dashboard` }, //{ label: "Wormholescan", href: `https://wormholescan.io` }, { label: "Advanced Tools", href: `${PUBLIC_URL}/advanced-tools/` },