Skip to content

Commit

Permalink
480 - fix variable replacemente issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Nov 21, 2023
1 parent 8c413b1 commit bc18c53
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 17 deletions.
52 changes: 39 additions & 13 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: xlabs/portal-bridge-ui
# TODO replace with the advance tools branch after cutover
ref: main
- name: Set up Node environment
uses: actions/setup-node@v3
with:
Expand All @@ -66,34 +70,56 @@ jobs:
git config user.name "xLabs CI"
git config user.email "[email protected]"
- name: Install dependencies
run: |
pushd apps/portal
npm install
run: npm install
- name: Set Version
id: set-version
run: |
pushd apps/portal
npm version $(node -p -e "require('./package.json').version")-P$(echo ${{ github.sha }} | cut -c -10)
run: npm version $(node -p -e "require('./package.json').version")-P$(echo ${{ github.sha }} | cut -c -10)
- name: Build
env:
PUBLIC_URL: "/${{ needs.branch-sha.outputs.value }}/advance"
PUBLIC_URL: "/${{ needs.branch-sha.outputs.value }}/advance-tools"
NODE_OPTIONS: "--max-old-space-size=10240"
REACT_APP_CLUSTER: ${{ vars.REACT_APP_CLUSTER }}
REACT_APP_SOLANA_API_URL: ${{ vars.REACT_APP_SOLANA_API_URL }}
REACT_APP_COVALENT_API_KEY: ${{ secrets.REACT_APP_COVALENT_API_KEY }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}
run: |
pushd apps/portal
pushd public
npm run set-version
popd
echo 'REACT_APP_VERSION=$npm_package_version' > .env
npm run build
cd build
npm run set-version
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: preview-advance-build
path: apps/portal/build
name: build-advance-tools
path: build

redirects:
name: "Build Portal Bridge"
runs-on: "ubuntu-latest"
concurrency:
group: ${{ github.ref }}-redicts-preview
cancel-in-progress: true
needs:
- branch-sha
steps:
- name: Set up Node environment
uses: actions/setup-node@v3
with:
node-version: v18.17.1
- name: Checkout Portal Bridge
uses: actions/checkout@v3
- name: Build Redirects
env:
PUBLIC_URL: "/${{ needs.branch-sha.outputs.value }}"
run: |
pushd apps/redirects
npm ci
npm run build
- name: Upload Portal Bridge Artifact
uses: actions/upload-artifact@v3
with:
name: preview-connect-build
path: apps/redirects/dist

connect:
name: "Build Portal Bridge"
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ Portal Bridge with Connect widget

### [apps/docs](./apps/docs/)

Portal Bridge documentation
Portal Bridge documentation

## Act

act --artifact-server-path /tmp/act-artifacts -W .github/workflows/preview.yml pull_request -j redirects
4 changes: 2 additions & 2 deletions apps/redirects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"clean": "shx rm -rf dist && shx rm -rf src/configs/*.json ",
"prebuild": "npm run clean && shx mkdir -p dist/{sui,cosmos} ",
"build": "npm run create:config:all && npm run build:all",
"create:config:sui": "DOTENV_CONFIG_PATH=./src/configs/sui.env ts-node -r dotenv/config src/index.ts > src/configs/sui.json",
"create:config:cosmos": "DOTENV_CONFIG_PATH=./src/configs/cosmos.env ts-node -r dotenv/config src/index.ts > src/configs/cosmos.json",
"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",
"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",
Expand Down
1 change: 0 additions & 1 deletion apps/redirects/src/configs/cosmos.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
TITLE="Cosmos Token Bridge"
DESCRIPTION="Portal is a bridge that offers unlimited transfers across chains for tokens and NFTs wrapped by Wormhole."
MAIN=${PUBLIC_URL}/?sourceChain=cosmos

0 comments on commit bc18c53

Please sign in to comment.