Skip to content

Referral program

Referral program #2069

Workflow file for this run

name: Build pull request
on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
inputs:
BACKEND_ENV:
default: ''
description: 'Backend env for special features'
required: false
FEATURE_PAYMASTER:
default: 'off'
description: 'Feature flag for paymaster transactions ("on" | "off")'
required: false
DEFI_SDK_API_URL:
default: wss://api-v4.zerion.io/
description: 'Zerion API'
required: true
DEFI_SDK_TESTNET_API_URL:
default: wss://api-testnet.zerion.io/
description: 'Zerion API Testnet'
required: true
ZERION_API_URL:
default: https://zpi.zerion.io/
description: 'Zerion REST API'
required: true
ZERION_TESTNET_API_URL:
default: https://zpi-testnet.zerion.io/
description: 'Zerion REST API'
required: true
PROXY_URL:
default: https://proxy.zerion.io/
description: 'Proxy API'
required: true
DEFI_SDK_TRANSACTIONS_API_URL:
default: https://transactions.zerion.io
description: 'Transaction Builder API'
required: true
SOCIAL_API_URL:
default: https://social.zerion.io/
description: 'Zerion Social API'
required: true
PR_NUMBER:
default: ''
description: 'Pull request to attach the build to, e.g. 468'
required: false
jobs:
build_pull_request:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install dependencies and build
env:
DEFI_SDK_API_URL: ${{ github.event.inputs.DEFI_SDK_API_URL || 'wss://api-v4.zerion.io/' }}
DEFI_SDK_TESTNET_API_URL: ${{ github.event.inputs.DEFI_SDK_TESTNET_API_URL || 'wss://api-testnet.zerion.io/' }}
ZERION_API_URL: ${{ github.event.inputs.ZERION_API_URL || 'https://zpi.zerion.io/' }}
ZERION_TESTNET_API_URL: ${{ github.event.inputs.ZERION_TESTNET_API_URL || 'https://zpi-testnet.zerion.io/' }}
BACKEND_ENV: ${{ github.event.inputs.BACKEND_ENV || '' }}
FEATURE_PAYMASTER: ${{ github.event.inputs.FEATURE_PAYMASTER || 'on' }}
PROXY_URL: ${{ github.event.inputs.PROXY_URL || 'https://proxy.zerion.io/' }}
DEFI_SDK_TRANSACTIONS_API_URL: ${{ github.event.inputs.DEFI_SDK_TRANSACTIONS_API_URL || 'https://transactions.zerion.io' }}
DEFI_SDK_API_TOKEN: Zerion.0JOY6zZTTw6yl5Cvz9sdmXc7d5AhzVMG
SOCIAL_API_URL: ${{ github.event.inputs.SOCIAL_API_URL || 'https://social.zerion.io/' }}
TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }}
FEATURE_SEND_FORM: on
FEATURE_FOOTER_BUG_BUTTON: off
MIXPANEL_TOKEN_PUBLIC: ${{ secrets.MIXPANEL_TOKEN_PUBLIC_DEV }}
run: |
npm install
npm run build:production
- name: Save PR number
if: ${{ success() }}
env:
PR_NUMBER: ${{ github.event.inputs.PR_NUMBER || github.event.number }}
run: |
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
- uses: actions/upload-artifact@v3
with:
name: pr_number
path: pr/
- name: Compress build artifacts
if: ${{ success() }}
shell: bash
run: |
mv dist zerion-wallet-extension-${{github.sha}}
zip -r zerion-wallet-extension-${{github.sha}}.zip zerion-wallet-extension-${{github.sha}}
- name: Upload build
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: zerion-wallet-extension
path: zerion-wallet-extension-${{github.sha}}.zip
- name: Notify build succeeded
id: notify-build-succeeded
if: ${{ success() }}
uses: slackapi/[email protected]
with:
channel-id: 'C04JLLQRB43'
payload: |
{
"text": ${{ toJSON(format('Build: {0}', github.event.pull_request.title)) }},
"icon_emoji": ":nyancat:",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ${{ toJSON(format('<{0}|{1}> {2}', github.event.pull_request.html_url, github.event.pull_request.title, github.pull_request.draft && ':construction:' || '')) }}
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "*Initiated by:* ${{ github.triggering_actor }}"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_AUTH_TOKEN }}
- name: Notify build failed
id: notify-build-failed
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
channel-id: 'C04JLLQRB43'
payload: |
{
"text": ${{ toJSON(format('Build: {0}', github.event.pull_request.title)) }},
"icon_emoji": ":cry-cat:",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ${{ toJSON(format('<{0}|{1}> {2}', github.event.pull_request.html_url, github.event.pull_request.title, github.pull_request.draft && ':construction:' || '')) }}
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "*Initiated by*: ${{ github.triggering_actor }}"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_AUTH_TOKEN }}