Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci #2

Merged
merged 20 commits into from
Dec 21, 2023
78 changes: 59 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,17 @@ jobs:
name: build-redirects
path: apps/redirects/dist


usdc-bridge:
name: "USDC Bridge"
wormhole-connect:
name: "Wormhole Connect"
runs-on: "ubuntu-latest"
concurrency:
group: ${{ github.ref }}-${{inputs.name}}-usdc-bridge
group: ${{ github.ref }}-${{inputs.name}}-wormhole-connect
cancel-in-progress: true
environment: ${{inputs.environment}}
outputs:
pkg-version: ${{ steps.set-version.outputs._PKG_VERSION }}
js-sha-384: ${{ steps.set-version.outputs._JS_SHA_384 }}
css-sha-384: ${{ steps.set-version.outputs._CSS_SHA_384 }}
steps:
- name: Set up Node environment
uses: actions/setup-node@v3
Expand All @@ -208,6 +209,45 @@ jobs:
echo "_JS_SHA_384=$(shasum -b -a 384 wormhole-connect-loader/dist/main.js | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}"
echo "_CSS_SHA_384=$(shasum -b -a 384 wormhole-connect-loader/dist/main.css | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}"
npm link --workspaces --if-present
rm -rf node_modules wormhole-connect-loader/node_modules wormhole-connect/node_modules sdk/node_modules builder/node_modules
popd
tar -cvf wormhole-connect.tar wormhole-connect
- name: Upload Wormhole Connect Artifact
uses: actions/upload-artifact@v3
with:
name: build-wormhole-connect
path: wormhole-connect.tar

usdc-bridge:
name: "USDC Bridge"
runs-on: "ubuntu-latest"
needs:
- wormhole-connect
concurrency:
group: ${{ github.ref }}-${{inputs.name}}-usdc-bridge
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: Download Wormhole Connect Artifact
uses: actions/download-artifact@v3
with:
name: build-wormhole-connect
path: artifacts
- name: extract wormhole-connect
run: |
tar -xvf artifacts/wormhole-connect.tar
- name: Link Wormhole Connect
id: wormhole-connect
run: |
npm install -g husky
pushd wormhole-connect
npm link --workspaces --if-present
- name: Checkout Custom Wormhole Connect Loader
uses: actions/checkout@v3
with:
Expand All @@ -229,8 +269,8 @@ jobs:
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_JS_WC_INTEGRITY_SHA_384: ${{ needs.wormhole-connect.outputs.js-sha-384 }}
VITE_APP_CSS_WC_INTEGRITY_SHA_384: ${{ needs.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
Expand All @@ -250,6 +290,8 @@ jobs:
concurrency:
group: ${{ github.ref }}-${{inputs.name}}-token-bridge
cancel-in-progress: true
needs:
- wormhole-connect
environment: ${{inputs.environment}}
outputs:
pkg-version: ${{ steps.set-version.outputs._PKG_VERSION }}
Expand All @@ -258,21 +300,19 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: v18.17.1
- name: Checkout Wormhole Connect
uses: actions/checkout@v3
- name: Download Wormhole Connect Artifact
uses: actions/download-artifact@v3
with:
repository: wormhole-foundation/wormhole-connect
ref: ${{inputs.connect-branch}}
path: wormhole-connect
- name: Build Wormhole Connect
name: build-wormhole-connect
path: artifacts
- name: Extract Wormhole Connect Artifact
run: |
tar -xvf artifacts/wormhole-connect.tar
- name: Link Wormhole Connect
id: wormhole-connect
run: |
npm install -g husky
pushd wormhole-connect
npm ci --workspaces --if-present
npm run build
echo "_JS_SHA_384=$(shasum -b -a 384 wormhole-connect-loader/dist/main.js | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}"
echo "_CSS_SHA_384=$(shasum -b -a 384 wormhole-connect-loader/dist/main.css | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}"
npm link --workspaces --if-present
- name: Checkout Custom Wormhole Connect Loader
uses: actions/checkout@v3
Expand All @@ -294,8 +334,8 @@ jobs:
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_JS_WC_INTEGRITY_SHA_384: ${{ needs.wormhole-connect.outputs.js-sha-384 }}
VITE_APP_CSS_WC_INTEGRITY_SHA_384: ${{ needs.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
Expand Down Expand Up @@ -361,7 +401,7 @@ jobs:
registry-url: https://npm.pkg.github.com
- name: Create Package.json
run: |
jq -n --arg version ${{ needs.token-bridge.outputs.pkg-version }} '{"name": "@xlabs/portal-bridge-ui", "version": $version }' > package.json
jq -n --arg version ${{ needs.token-bridge.outputs.pkg-version }} '{"name": "@${{ github.repository }}", "version": $version }' > package.json
- name: Upload Portal Bridge Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
public-url: "/${{ needs.branch-sha.outputs.value }}"
project-branch: ${{ github.event.pull_request.head.ref }}
secrets: inherit
needs:
needs:
- branch-sha
deploy:
name: "Deploy Testnet"
Expand Down Expand Up @@ -59,6 +59,6 @@ jobs:
cat .latest >> .artifacts
echo ${{ needs.build.outputs.pkg-version }} > .latest
git add .artifacts .latest
git commit -m"Update testnet artifacts ${{ needs.build.outputs.pkg-version }}"
git commit -m "Update testnet artifacts ${{ needs.build.outputs.pkg-version }}"
git push
echo "The testnet URL is: ${{ vars.TESTNET_ROOT_URL }}/${{ needs.branch-sha.outputs.value }}/" >> ${GITHUB_STEP_SUMMARY}
echo "The testnet URL is: ${{ vars.TESTNET_ROOT_URL }}/${{ needs.branch-sha.outputs.value }}/" >> ${GITHUB_STEP_SUMMARY}
2 changes: 1 addition & 1 deletion apps/rewards-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rewards-dashboard",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
Loading