Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ REACT_APP_ENV_NAME=testing
# REACT_APP_ENV_NAME=production

# IPFS Gateway
REACT_APP_IPFS_GATEWAY=https://bosonprotocol.infura-ipfs.io/ipfs
REACT_APP_IPFS_GATEWAY=https://<your-gateway>.mypinata.cloud/ipfs

# Infura IPFS project ID, used for auth header
REACT_APP_INFURA_IPFS_PROJECT_ID=

# Infura IPFS project secret, used for auth header
REACT_APP_INFURA_IPFS_PROJECT_SECRET=
# Pinata JWT, used for the auth header when uploading to IPFS
REACT_APP_IPFS_JWT=

# WalletConnect ProjectId
REACT_APP_WALLET_CONNECT_PROJECT_ID=
Expand Down
9 changes: 0 additions & 9 deletions .fleek.json

This file was deleted.

9 changes: 0 additions & 9 deletions .fleek_production.json

This file was deleted.

9 changes: 0 additions & 9 deletions .fleek_staging.json

This file was deleted.

17 changes: 17 additions & 0 deletions .github/actions/setup-node-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Setup Node and npm"
description: >-
Installs Node at the version in .nvmrc with the npm cache restored. Requires the repository
to be checked out. Note that the `npm ci` performed by callers runs this package's
postinstall (`copy-zoid`), which generates the git-ignored public/scripts/zoid directory
the build needs - so install must always precede build.

runs:
using: composite
steps:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
cache: "npm"
cache-dependency-path: "./package-lock.json"
176 changes: 35 additions & 141 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,151 +1,45 @@
name: Call reusable workflow - Widgets
name: CI - Widgets

# On pushes to main this is invoked by deploy-testing.yaml via workflow_call, so that the
# deploy is gated on it rather than racing it.
on:
release:
types: [created]
pull_request:
branches:
- main
workflow_dispatch:
workflow_call:

jobs:
prejob:
name: Get Latest Tag
runs-on: ubuntu-22.04
outputs:
releaseTag: ${{ steps.tag.outputs.tag }}
releaseName: ${{ steps.name.outputs.name }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- uses: "WyriHaximus/github-action-get-previous-tag@v1"
id: tag
- run: echo "name=$(git describe --tags)" >> $GITHUB_OUTPUT
id: name

call-reusable-workflow-PR:
uses: ./.github/workflows/ci_reusable.yaml
if: github.event_name == 'pull_request'
needs: prejob
with:
ENV_NAME: "staging"
REACT_APP_ENV_NAME: "staging"
DEPLOY_TO_FLEEK: false
REACT_APP_RELEASE_TAG: ${{ needs.prejob.outputs.releaseTag }}
REACT_APP_RELEASE_NAME: ${{ needs.prejob.outputs.releaseName }}
REACT_APP_META_TX_API_KEY_MAP: ${{ vars.REACT_APP_META_TX_API_KEY_MAP }}
REACT_APP_META_TX_API_IDS_MAP: ${{ vars.REACT_APP_META_TX_API_IDS_MAP }}
secrets:
FLEEK_API_KEY: ${{ secrets.FLEEK_API_KEY }}
REACT_APP_INFURA_IPFS_PROJECT_ID: ${{ secrets.REACT_APP_INFURA_IPFS_PROJECT_ID }}
REACT_APP_INFURA_IPFS_PROJECT_SECRET: ${{ secrets.REACT_APP_INFURA_IPFS_PROJECT_SECRET }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID_STAGING }}
REACT_APP_MAGIC_API_KEY: ${{ secrets.REACT_APP_MAGIC_API_KEY_STAGING }}
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY_STAGING }}

call-reusable-workflow-staging:
uses: ./.github/workflows/ci_reusable.yaml
if: github.event_name == 'release' && github.event.action == 'created'
needs: prejob
with:
ENV_NAME: "staging"
REACT_APP_ENV_NAME: "staging"
DEPLOY_TO_FLEEK: true
REACT_APP_RELEASE_TAG: ${{ needs.prejob.outputs.releaseTag }}
REACT_APP_RELEASE_NAME: ${{ needs.prejob.outputs.releaseName }}
REACT_APP_META_TX_API_KEY_MAP: ${{ vars.REACT_APP_META_TX_API_KEY_MAP }}
REACT_APP_META_TX_API_IDS_MAP: ${{ vars.REACT_APP_META_TX_API_IDS_MAP }}
secrets:
FLEEK_API_KEY: ${{ secrets.FLEEK_API_KEY }}
REACT_APP_INFURA_IPFS_PROJECT_ID: ${{ secrets.REACT_APP_INFURA_IPFS_PROJECT_ID }}
REACT_APP_INFURA_IPFS_PROJECT_SECRET: ${{ secrets.REACT_APP_INFURA_IPFS_PROJECT_SECRET }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID_STAGING }}
REACT_APP_MAGIC_API_KEY: ${{ secrets.REACT_APP_MAGIC_API_KEY_STAGING }}
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY_STAGING }}
FLEEK_TOKEN: ${{ secrets.FLEEK_TOKEN }}
FLEEK_PROJECT_ID: ${{ secrets.FLEEK_PROJECT_ID }}
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

call-reusable-workflow-production:
uses: ./.github/workflows/ci_reusable.yaml
if: github.event_name == 'workflow_dispatch'
needs: prejob
with:
ENV_NAME: "production"
REACT_APP_ENV_NAME: "production"
DEPLOY_TO_FLEEK: true
REACT_APP_RELEASE_TAG: ${{ needs.prejob.outputs.releaseTag }}
REACT_APP_RELEASE_NAME: ${{ needs.prejob.outputs.releaseName }}
REACT_APP_META_TX_API_KEY_MAP: ${{ vars.REACT_APP_META_TX_API_KEY_MAP }}
REACT_APP_META_TX_API_IDS_MAP: ${{ vars.REACT_APP_META_TX_API_IDS_MAP }}
secrets:
FLEEK_API_KEY: ${{ secrets.FLEEK_API_KEY }}
REACT_APP_INFURA_IPFS_PROJECT_ID: ${{ secrets.REACT_APP_INFURA_IPFS_PROJECT_ID }}
REACT_APP_INFURA_IPFS_PROJECT_SECRET: ${{ secrets.REACT_APP_INFURA_IPFS_PROJECT_SECRET }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID_PRODUCTION }}
REACT_APP_MAGIC_API_KEY: ${{ secrets.REACT_APP_MAGIC_API_KEY_PRODUCTION }}
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY_PRODUCTION }}
FLEEK_TOKEN: ${{ secrets.FLEEK_TOKEN }}
FLEEK_PROJECT_ID: ${{ secrets.FLEEK_PROJECT_ID }}

job-summary:
name: Create Job Summary
jobs:
checks:
name: Format, lint, types and build
runs-on: ubuntu-22.04
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
needs:
[
call-reusable-workflow-staging,
call-reusable-workflow-production
]
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Install JQ
uses: r26d/jq-action@master
with:
cmd: jq -n env
- name: Get job outputs
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-node-npm

- run: npm ci

# Non-mutating checks: `npm run prettier` and `npm run lint` rewrite files, which would
# make them pass unconditionally and would leave the build compiling something other
# than the committed code.
- run: npm run prettier:check
- run: npm run lint:check
- run: npm run tsc

# Every other path already builds this commit against the real environment values -
# deploy-preview.yaml for a PR, deploy-testing.yaml for a push to main - and a deploy
# that fails to build publishes nothing. Repeating it here would spend a second full
# build on the same tree. Fork PRs get no preview deployment (see the `if:` in
# deploy-preview.yaml), so they are built here. No env vars are needed: CRA compiles
# src/config.ts without executing it.
- name: Build (fork PRs only)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
env:
OUTPUTS: ${{ toJSON(needs) }}
run: |
succeededJobOutput="$(
echo '${{ env.OUTPUTS }}' | jq '.[] | select(.result | startswith("success")) | .outputs'
)"
echo 'JOB_OUTPUT='$succeededJobOutput >> $GITHUB_ENV
- name: Get job vars
run: |
jobLint="$(
echo '${{ env.JOB_OUTPUT }}' |
jq '.JOB_LINT'
)"
echo 'JOB_LINT='$jobLint >> $GITHUB_ENV

jobBuild="$(
echo '${{ env.JOB_OUTPUT }}' |
jq '.JOB_BUILD'
)"
echo 'JOB_BUILD='$jobBuild >> $GITHUB_ENV

deployUrl="$(
echo '${{ env.JOB_OUTPUT }}' |
jq '.DEPLOY_URL'
)"
echo 'DEPLOY_URL='$deployUrl >> $GITHUB_ENV

- name: Adding Job Summary
run: |
echo "| Command | Status |" >> $GITHUB_STEP_SUMMARY
echo "| ---- | ---- |" >> $GITHUB_STEP_SUMMARY
if [ ${{ env.JOB_LINT }} == success ]; then
echo "| Lint | ✅ |" >> $GITHUB_STEP_SUMMARY
else
echo "| Lint | ❌ |" >> $GITHUB_STEP_SUMMARY
fi
if [ ${{ env.JOB_BUILD }} == success ]; then
echo "| Build | ✅ |" >> $GITHUB_STEP_SUMMARY
else
echo "| Build | ❌ |" >> $GITHUB_STEP_SUMMARY
fi
- name: Adding Job Summary Deploy Url
if: ${{ env.DEPLOY_URL }}
run: echo "| URL | ${{ env.DEPLOY_URL }} |" >> $GITHUB_STEP_SUMMARY
GENERATE_SOURCEMAP: "false"
run: npm run build
119 changes: 0 additions & 119 deletions .github/workflows/ci_reusable.yaml

This file was deleted.

Loading
Loading