Skip to content

Commit

Permalink
update ci preview.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Oct 11, 2023
1 parent 28c150d commit ffb0a4a
Showing 1 changed file with 31 additions and 57 deletions.
88 changes: 31 additions & 57 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,6 @@ on:
types: [opened, synchronize, reopened]

jobs:
# cctp:
# name: "Build USDC Bridge (CCTP)"
# runs-on: "ubuntu-latest"
# concurrency:
# group: ${{ github.ref }}-cctp-preview
# cancel-in-progress: true
# environment: Cloudflare-Preview
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# repository: xlabs/usdc-bridge
# ref: develop
# - name: Set up Node environment
# uses: actions/setup-node@v3
# with:
# node-version: v16.19.1
# - name: Install dependencies
# run: npm ci
# - name: Set Version
# run: |
# echo "_BRANCH_NAME_SHA=$(echo ${{ github.event.pull_request.head.ref }} | sha256sum | cut -c -10)" >> "${GITHUB_ENV}"
# - name: Build
# env:
# DEPLOY: "true"
# NEXT_PUBLIC_NETWORK: ${{ vars.REACT_APP_CLUSTER }}
# NEXT_PUBLIC_BASE_PATH: "/${{ env._BRANCH_NAME_SHA }}/usdc-bridge"
# run: npm run build
# - name: Upload Artifact
# uses: actions/upload-artifact@v3
# with:
# name: preview-stable-bridge-build
# path: out
docs:
name: "Build Portal Bridge Documentation"
runs-on: "ubuntu-latest"
Expand All @@ -49,7 +16,7 @@ jobs:
- name: Set up Node environment
uses: actions/setup-node@v3
with:
node-version: v18.17.1
node-version: v16.19.1
- name: Install dependencies
run: |
pushd docs
Expand All @@ -68,51 +35,64 @@ jobs:
with:
name: docs-preview-build
path: docs/build

portal:
name: "Build Portal Bridge"
runs-on: xlabs-large-runner
runs-on: "ubuntu-latest"
concurrency:
group: ${{ github.ref }}-portal-preview
cancel-in-progress: true
environment: Cloudflare-Preview
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node environment
uses: actions/setup-node@v3
with:
node-version: v18.17.1
- name: Checkout Wormhole Connect
uses: actions/checkout@v3
with:
repository: xlabs/wormhole-connect
ref: ${{github.event.pull_request.head.ref}}
path: wormhole-connect
- name: Checkout Portal Bridge
uses: actions/checkout@v3
with:
path: portal-bridge
- name: Setup Git
run: |
cd portal-bridge
git config user.name "xLabs CI"
git config user.email "[email protected]"
- name: Install dependencies
run: npm install
- name: Set Version
- name: Set Portal Bridge Version
run: |
cd portal-bridge
npm version $(node -p -e "require('./package.json').version")-P$(echo ${{ github.sha }} | cut -c -10)
echo "_PKG_VERSION=$(node -p -e "require('./package.json').version")" >> "${GITHUB_ENV}"
echo "_BRANCH_NAME_SHA=$(echo ${{ github.event.pull_request.head.ref }} | sha256sum | cut -c -10)" >> "${GITHUB_ENV}"
- name: Build
- name: Build Portal Bridge
env:
PUBLIC_URL: "/${{ env._BRANCH_NAME_SHA }}"
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 }}
VITE_APP_VERSION: ${{ github.event.pull_request.head.ref }}
VITE_APP_CLUSTER: "mainnet"
run: |
npm install -g husky
pushd wormhole-connect
npm ci --workspaces --if-present
npm run build
npm link --workspaces --if-present
popd
pushd portal-bridge
npm ci
npm link @wormhole-foundation/wormhole-connect
pushd public
npm run set-version
popd
echo 'REACT_APP_VERSION=$npm_package_version' > .env
echo 'VITE_APP_VERSION=$npm_package_version' > .env
npm run build
- name: Upload Artifact
- name: Upload Portal Bridge Artifact
uses: actions/upload-artifact@v3
with:
name: preview-build
path: build
path: portal-bridge/dist
- name: Deploy metadata
run: |
mkdir deploy-metadata
Expand All @@ -130,7 +110,6 @@ jobs:
needs:
- portal
- docs
# - cctp
runs-on: "ubuntu-latest"
concurrency:
group: ${{ github.ref }}-publish-preview
Expand All @@ -148,15 +127,10 @@ jobs:
with:
name: docs-preview-build
path: docs
# - name: Download Artifact
# uses: actions/download-artifact@v3
# with:
# name: preview-stable-bridge-build
# path: usdc-bridge
- name: Set up GitHub NPM registry
uses: actions/setup-node@v3
with:
node-version: v18.17.1
node-version: v16.19.1
registry-url: https://npm.pkg.github.com
- name: Publish
env:
Expand Down

0 comments on commit ffb0a4a

Please sign in to comment.