From 3bd9547622a11620d7951f26152ba974bd04adef Mon Sep 17 00:00:00 2001 From: junkwarrior87 <115852752+junkwarrior87@users.noreply.github.com> Date: Mon, 25 Dec 2023 10:16:14 +0000 Subject: [PATCH] #1 change colors and update to newest blockscoutV2 --- .github/workflows/checks.yml | 171 ----------- .github/workflows/cleanup.yml | 33 -- .github/workflows/deploy-main.yml | 40 --- .github/workflows/deploy-review-l2.yml | 38 --- .github/workflows/deploy-review.yml | 38 --- .github/workflows/docker.yml | 23 ++ .github/workflows/e2e-tests.yml | 50 ---- .github/workflows/label-issues-in-release.yml | 282 ------------------ .github/workflows/pre-release.yml | 61 ---- .github/workflows/project-management.yml | 89 ------ .github/workflows/publish-image.yml | 64 ---- .github/workflows/release.yml | 86 ------ .github/workflows/stale-issues.yml | 29 -- .github/workflows/update-project-cards.yml | 240 --------------- .github/workflows/upload-source-maps.yml | 48 --- pages/_document.tsx | 6 +- public/icon.png | Bin 0 -> 21588 bytes public/logo.png | Bin 0 -> 12331 bytes theme/foundations/semanticTokens.ts | 2 +- ui/home/StatsItem.tsx | 5 +- ui/home/indicators/ChainIndicatorChart.tsx | 2 +- ui/home/indicators/ChainIndicators.tsx | 1 + ui/shared/LinkInternal.tsx | 2 +- ui/shared/Tabs/TabsWithScroll.tsx | 2 +- ui/shared/chart/ChartArea.tsx | 4 +- ui/shared/pagination/Pagination.tsx | 4 + ui/snippets/navigation/useColors.ts | 6 +- ui/snippets/topBar/TopBar.tsx | 2 +- 28 files changed, 46 insertions(+), 1282 deletions(-) delete mode 100644 .github/workflows/checks.yml delete mode 100644 .github/workflows/cleanup.yml delete mode 100644 .github/workflows/deploy-main.yml delete mode 100644 .github/workflows/deploy-review-l2.yml delete mode 100644 .github/workflows/deploy-review.yml create mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/e2e-tests.yml delete mode 100644 .github/workflows/label-issues-in-release.yml delete mode 100644 .github/workflows/pre-release.yml delete mode 100644 .github/workflows/project-management.yml delete mode 100644 .github/workflows/publish-image.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/stale-issues.yml delete mode 100644 .github/workflows/update-project-cards.yml delete mode 100644 .github/workflows/upload-source-maps.yml create mode 100644 public/icon.png create mode 100644 public/logo.png diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index eb0810c8f5..0000000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,171 +0,0 @@ -name: Checks -on: - workflow_call: - workflow_dispatch: - pull_request: - types: [ opened, synchronize, unlabeled ] - paths-ignore: - - '.github/ISSUE_TEMPLATE/**' - - '.husky/**' - - '.vscode/**' - - 'deploy/**' - - 'docs/**' - - 'public/**' - - 'stub/**' - - 'tools/**' - -# concurrency: -# group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }} -# cancel-in-progress: true - -jobs: - code_quality: - name: Code quality - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip checks') && !(github.event.action == 'unlabeled' && github.event.label.name != 'skip checks') }} - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v3 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Run ESLint - run: yarn lint:eslint - - - name: Compile TypeScript - run: yarn lint:tsc - - envs_validation: - name: ENV variables validation - runs-on: ubuntu-latest - needs: [ code_quality ] - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v3 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Install script dependencies - run: cd ./deploy/tools/envs-validator && yarn --frozen-lockfile --ignore-optional - - - name: Run validation tests - run: | - set +e - cd ./deploy/tools/envs-validator && yarn test - exitcode="$?" - echo "exitcode=$exitcode" >> $GITHUB_OUTPUT - exit "$exitcode" - - jest_tests: - name: Jest tests - needs: [ code_quality, envs_validation ] - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v3 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Run Jest - run: yarn test:jest - - pw_tests: - name: 'Playwright tests / Project: ${{ matrix.project }}' - needs: [ code_quality, envs_validation ] - runs-on: ubuntu-latest - container: - image: mcr.microsoft.com/playwright:v1.35.1-focal - - strategy: - fail-fast: false - matrix: - project: [ default, mobile, dark-color-mode ] - - steps: - - name: Install git-lfs - run: apt-get update && apt-get install git-lfs - - - name: Checkout repo - uses: actions/checkout@v3 - with: - lfs: 'true' - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v3 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Run PlayWright - run: yarn test:pw:ci - env: - HOME: /root - PW_PROJECT: ${{ matrix.project }} - - - name: Upload test results - if: always() - uses: actions/upload-artifact@v3 - with: - name: playwright-report-${{ matrix.project }} - path: playwright-report - retention-days: 10 \ No newline at end of file diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml deleted file mode 100644 index a8ed3ee27a..0000000000 --- a/.github/workflows/cleanup.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Cleanup environments - -on: - pull_request: - types: - - closed - - merged - workflow_dispatch: - -jobs: - cleanup_release: - uses: blockscout/blockscout-ci-cd/.github/workflows/cleanup_helmfile.yaml@master - with: - appName: review-l2-$GITHUB_REF_NAME_SLUG - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit - cleanup_l2_release: - uses: blockscout/blockscout-ci-cd/.github/workflows/cleanup_helmfile.yaml@master - with: - appName: review-$GITHUB_REF_NAME_SLUG - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit - cleanup_docker_image: - uses: blockscout/blockscout-ci-cd/.github/workflows/cleanup_docker.yaml@master - with: - dockerImage: review-$GITHUB_REF_NAME_SLUG - secrets: inherit diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml deleted file mode 100644 index d8cf2b79b3..0000000000 --- a/.github/workflows/deploy-main.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Deploy from main branch - -on: - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - publish_image: - name: Publish Docker image - uses: './.github/workflows/publish-image.yml' - secrets: inherit - - deploy_main: - name: Deploy frontend - needs: publish_image - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: front - globalEnv: main - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit - - deploy_l2: - name: Deploy frontend (L2) - needs: publish_image - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: l2-optimism-goerli - globalEnv: optimism-goerli - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit diff --git a/.github/workflows/deploy-review-l2.yml b/.github/workflows/deploy-review-l2.yml deleted file mode 100644 index 02feb3ce64..0000000000 --- a/.github/workflows/deploy-review-l2.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Deploy review environment (L2) - -on: - workflow_dispatch: - -jobs: - make_slug: - name: Make GitHub reference slug - runs-on: ubuntu-latest - outputs: - REF_SLUG: ${{ steps.output.outputs.REF_SLUG }} - steps: - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4.4.1 - - - name: Set output - id: output - run: echo "REF_SLUG=${{ env.GITHUB_REF_NAME_SLUG }}" >> $GITHUB_OUTPUT - - publish_image: - name: Publish Docker image - needs: make_slug - uses: './.github/workflows/publish-image.yml' - with: - tags: ghcr.io/blockscout/frontend:review-${{ needs.make_slug.outputs.REF_SLUG }} - secrets: inherit - - deploy_review_l2: - name: Deploy frontend (L2) - needs: [ make_slug, publish_image ] - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: review-l2-${{ needs.make_slug.outputs.REF_SLUG }} - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit diff --git a/.github/workflows/deploy-review.yml b/.github/workflows/deploy-review.yml deleted file mode 100644 index c5edbc8c50..0000000000 --- a/.github/workflows/deploy-review.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Deploy review environment - -on: - workflow_dispatch: - -jobs: - make_slug: - name: Make GitHub reference slug - runs-on: ubuntu-latest - outputs: - REF_SLUG: ${{ steps.output.outputs.REF_SLUG }} - steps: - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4.4.1 - - - name: Set output - id: output - run: echo "REF_SLUG=${{ env.GITHUB_REF_NAME_SLUG }}" >> $GITHUB_OUTPUT - - publish_image: - name: Publish Docker image - needs: make_slug - uses: './.github/workflows/publish-image.yml' - with: - tags: ghcr.io/blockscout/frontend:review-${{ needs.make_slug.outputs.REF_SLUG }} - secrets: inherit - - deploy_review: - name: Deploy frontend - needs: [ make_slug, publish_image ] - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: review-${{ needs.make_slug.outputs.REF_SLUG }} - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000..2e3d86363d --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,23 @@ +name: Build and push Docker image + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + - uses: azure/docker-login@v1 + with: + login-server: ataacr.azurecr.io + username: ${{ secrets.ATA_ACR_USERNAME }} + password: ${{ secrets.ATA_ACR_PASSWORD }} + - uses: docker/build-push-action@v2 + with: + push: true + tags: ataacr.azurecr.io/blockscout-frontend:${{ github.sha }} diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml deleted file mode 100644 index 6aab1f48ff..0000000000 --- a/.github/workflows/e2e-tests.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Run E2E tests k8s - -on: - workflow_dispatch: - workflow_call: - -# concurrency: -# group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }} -# cancel-in-progress: true - -jobs: - publish_image: - name: Publish Docker image - uses: './.github/workflows/publish-image.yml' - secrets: inherit - - deploy_e2e: - name: Deploy E2E instance - needs: publish_image - runs-on: ubuntu-latest - permissions: write-all - steps: - - name: Get Vault credentials - id: retrieve-vault-secrets - uses: hashicorp/vault-action@v2.4.1 - with: - url: https://vault.k8s.blockscout.com - role: ci-dev - path: github-jwt - method: jwt - tlsSkipVerify: false - exportToken: true - secrets: | - ci/data/dev/github token | WORKFLOW_TRIGGER_TOKEN ; - - name: Trigger deploy - uses: convictional/trigger-workflow-and-wait@v1.6.1 - with: - owner: blockscout - repo: deployment-values - github_token: ${{ env.WORKFLOW_TRIGGER_TOKEN }} - workflow_file_name: deploy_blockscout.yaml - ref: main - wait_interval: 30 - client_payload: '{ "instance": "dev", "globalEnv": "e2e"}' - - test: - name: Run tests - needs: deploy_e2e - uses: blockscout/blockscout-ci-cd/.github/workflows/e2e_new.yaml@master - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/label-issues-in-release.yml b/.github/workflows/label-issues-in-release.yml deleted file mode 100644 index 4bc9861b0d..0000000000 --- a/.github/workflows/label-issues-in-release.yml +++ /dev/null @@ -1,282 +0,0 @@ -name: Label issues in release - -on: - workflow_dispatch: - inputs: - tag: - description: 'Release tag' - required: true - type: string - label_name: - description: 'Name of the label' - required: true - type: string - label_description: - description: 'Description of the label' - default: '' - required: false - type: string - label_color: - description: 'A color of the added label' - default: 'FFFFFF' - required: false - type: string - workflow_call: - inputs: - tag: - description: 'Release tag' - required: true - type: string - label_name: - description: 'Name of the label' - required: true - type: string - label_description: - description: 'Description of the label' - default: '' - required: false - type: string - label_color: - description: 'A color of the added label' - default: 'FFFFFF' - required: false - type: string - outputs: - issues: - description: "JSON encoded list of issues linked to commits in the release" - value: ${{ jobs.run.outputs.issues }} - -# concurrency: -# group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }} -# cancel-in-progress: true - -jobs: - run: - name: Run - runs-on: ubuntu-latest - outputs: - issues: ${{ steps.linked_issues.outputs.result }} - steps: - - name: Getting tags of the two latestest releases - id: tags - uses: actions/github-script@v6 - env: - TAG: ${{ inputs.tag }} - with: - script: | - const { repository: { releases: { nodes: releases } } } = await github.graphql(` - query ($owner: String!, $repo: String!) { - repository(owner: $owner, name: $repo) { - releases(first: 10, orderBy: { field: CREATED_AT, direction: DESC }) { - nodes { - name - tagName - tagCommit { - oid - } - isPrerelease - isDraft - publishedAt - } - } - } - } - `, - { - owner: context.repo.owner, - repo: context.repo.repo, - } - ); - - if (releases[0].tagName !== process.env.TAG) { - core.info(`Current latest tag: ${ releases[0].tagName }`); - core.setFailed(`Release with tag ${ process.env.TAG } is not latest one.`); - return; - } - - const latestTag = process.env.TAG; - const [ { tagName: previousTag } ] = releases - .slice(1) - .filter(({ isDraft }) => !isDraft); - - core.info('Found following tags:'); - core.info(` latest: ${ latestTag }`); - core.info(` second latest: ${ previousTag }`); - - core.setOutput('latest', latestTag); - core.setOutput('previous', previousTag); - - - name: Looking for commits between two releases - id: commits - uses: actions/github-script@v6 - env: - PREVIOUS_TAG: ${{ steps.tags.outputs.previous }} - LATEST_TAG: ${{ steps.tags.outputs.latest }} - with: - script: | - const { data: { commits: commitsInRelease } } = await github.request('GET /repos/{owner}/{repo}/compare/{basehead}', { - owner: context.repo.owner, - repo: context.repo.repo, - basehead: `${ process.env.PREVIOUS_TAG }...${ process.env.LATEST_TAG }`, - }); - - if (commitsInRelease.length === 0) { - core.notice(`No commits found between ${ process.env.PREVIOUS_TAG } and ${ process.env.LATEST_TAG }`); - return []; - } - - const commits = commitsInRelease.map(({ sha }) => sha); - - core.startGroup(`Found ${ commits.length } commits`); - commits.forEach((sha) => { - core.info(sha); - }) - core.endGroup(); - - return commits; - - - name: Looking for issues linked to commits - id: linked_issues - uses: actions/github-script@v6 - env: - COMMITS: ${{ steps.commits.outputs.result }} - with: - script: | - const commits = JSON.parse(process.env.COMMITS); - - if (commits.length === 0) { - return []; - } - - const map = {}; - - core.startGroup(`Looking for linked issues`); - for (const sha of commits) { - const result = await getLinkedIssuesForCommitPR(sha); - result.forEach((issue) => { - map[issue] = issue; - }); - } - core.endGroup(); - - const issues = Object.values(map); - - if (issues.length > 0) { - core.startGroup(`Found ${ issues.length } unique issues`); - issues.sort().forEach((issue) => { - core.info(`#${ issue } - https://github.com/${ context.repo.owner }/${ context.repo.repo }/issues/${ issue }`); - }) - core.endGroup(); - } else { - core.notice('No linked issues found.'); - } - - return issues; - - async function getLinkedIssuesForCommitPR(sha) { - core.info(`Fetching issues for commit: ${ sha }`); - - const response = await github.graphql(` - query ($owner: String!, $repo: String!, $sha: GitObjectID!) { - repository(owner: $owner, name: $repo) { - object(oid: $sha) { - ... on Commit { - associatedPullRequests(first: 10) { - nodes { - number - title - state - merged - closingIssuesReferences(first: 10) { - nodes { - number - title - closed - } - } - } - } - } - } - } - } - `, { - owner: context.repo.owner, - repo: context.repo.repo, - sha, - }); - - if (!response) { - core.info('Nothing has found.'); - return []; - } - - const { repository: { object: { associatedPullRequests } } } = response; - - const issues = associatedPullRequests - .nodes - .map(({ closingIssuesReferences: { nodes: issues } }) => issues.map(({ number }) => number)) - .flat(); - - core.info(`Found following issues: ${ issues.join(', ') || '-' }\n`); - - return issues; - } - - - name: Creating label - id: label_creating - uses: actions/github-script@v6 - env: - LABEL_NAME: ${{ inputs.label_name }} - LABEL_COLOR: ${{ inputs.label_color }} - LABEL_DESCRIPTION: ${{ inputs.label_description }} - with: - script: | - try { - const result = await github.request('POST /repos/{owner}/{repo}/labels', { - owner: context.repo.owner, - repo: context.repo.repo, - name: process.env.LABEL_NAME, - color: process.env.LABEL_COLOR, - description: process.env.LABEL_DESCRIPTION, - }); - - core.info('Label was created.'); - } catch (error) { - if (error.status === 422) { - core.info('Label already exist.'); - } else { - core.setFailed(error.message); - } - } - - - - name: Adding label to issues - id: labeling_issues - uses: actions/github-script@v6 - env: - LABEL_NAME: ${{ inputs.label_name }} - ISSUES: ${{ steps.linked_issues.outputs.result }} - with: - script: | - const issues = JSON.parse(process.env.ISSUES); - - if (issues.length === 0) { - core.notice('No issues has found. Nothing to label.'); - return; - } - - for (const issue of issues) { - core.info(`Adding label to the issue #${ issue }...`); - await addLabelToIssue(issue, process.env.LABEL_NAME); - core.info('Done.\n'); - } - - async function addLabelToIssue(issue, label) { - return await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/labels', { - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue, - labels: [ label ], - }); - } diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml deleted file mode 100644 index e0cb8684b8..0000000000 --- a/.github/workflows/pre-release.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Pre-release - -on: - workflow_dispatch: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+*' # e.g v1.2.3-alpha.2 - -jobs: - checks: - name: Run code checks - uses: "./.github/workflows/checks.yml" - secrets: inherit - - # publish_image: - # image will be published in e2e-tests.yml workflow - # name: Publish Docker image - # uses: './.github/workflows/publish-image.yml' - # secrets: inherit - - e2e_tests: - name: Run e2e tests - needs: checks - uses: "./.github/workflows/e2e-tests.yml" - secrets: inherit - - version: - name: Pre-release version info - runs-on: ubuntu-latest - outputs: - is_initial: ${{ steps.is_initial.outputs.result }} - steps: - - name: Determine if it is the initial version of the pre-release - id: is_initial - uses: actions/github-script@v6 - env: - TAG: ${{ github.ref_name }} - with: - script: | - const tag = process.env.TAG; - const REGEXP = /^v[0-9]+.[0-9]+.[0-9]+-[a-z]+((\.|-)\d+)?$/i; - const match = tag.match(REGEXP); - const isInitial = match && !match[1] ? true : false; - core.info('is_initial flag value: ', isInitial); - return isInitial; - - label_issues: - name: Add pre-release label to issues - uses: './.github/workflows/label-issues-in-release.yml' - needs: [ version ] - if: ${{ needs.version.outputs.is_initial == 'true' }} - with: - tag: ${{ github.ref_name }} - label_name: 'pre-release' - label_description: Tasks in pre-release right now - secrets: inherit - - upload_source_maps: - name: Upload source maps to Sentry - uses: './.github/workflows/upload-source-maps.yml' - secrets: inherit diff --git a/.github/workflows/project-management.yml b/.github/workflows/project-management.yml deleted file mode 100644 index 791515b07d..0000000000 --- a/.github/workflows/project-management.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Project management -on: - issues: - types: [ closed ] - pull_request: - types: [ review_requested ] - -jobs: - not_planned_issue: - name: Update task for not planned issue - if: ${{ github.event.issue && github.event.action == 'closed' && github.event.issue.state_reason == 'not_planned' }} - uses: './.github/workflows/update-project-cards.yml' - with: - project_name: ${{ vars.PROJECT_NAME }} - field_name: Status - field_value: Done - issues: "[${{ github.event.issue.number }}]" - secrets: inherit - - completed_issue: - name: Update task for completed issue - if: ${{ github.event.issue && github.event.action == 'closed' && github.event.issue.state_reason == 'completed' }} - uses: './.github/workflows/update-project-cards.yml' - with: - project_name: ${{ vars.PROJECT_NAME }} - field_name: Status - field_value: Ready For Realease - issues: "[${{ github.event.issue.number }}]" - secrets: inherit - - review_requested_issues: - name: Get issues linked to PR - runs-on: ubuntu-latest - if: ${{ github.event.pull_request && github.event.action == 'review_requested' }} - outputs: - issues: ${{ steps.linked_issues.outputs.result }} - steps: - - name: Fetching issues linked to pull request - id: linked_issues - uses: actions/github-script@v6 - env: - PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} - with: - script: | - const response = await github.graphql(` - query ($owner: String!, $repo: String!, $pr: Int!) { - repository(owner: $owner, name: $repo) { - pullRequest(number: $pr) { - number - title - closingIssuesReferences(first: 100) { - nodes { - number - title - closed - } - } - } - } - } - `, { - owner: context.repo.owner, - repo: context.repo.repo, - pr: Number(process.env.PULL_REQUEST_NUMBER), - }); - - const { repository: { pullRequest: { closingIssuesReferences } } } = response; - const issues = closingIssuesReferences.nodes.map(({ number }) => number); - - if (!issues.length) { - core.notice(`No linked issues found for pull request #${ process.env.PULL_REQUEST_NUMBER }`); - return; - } - - core.info(`Found ${ issues.length } issue(s): ${ issues.join(', ') || '-' }`); - - return issues; - - review_requested_tasks: - name: Update status for issues in review - needs: [ review_requested_issues ] - if: ${{ needs.review_requested_issues.outputs.issues }} - uses: './.github/workflows/update-project-cards.yml' - secrets: inherit - with: - project_name: ${{ vars.PROJECT_NAME }} - field_name: Status - field_value: Review - issues: ${{ needs.review_requested_issues.outputs.issues }} diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml deleted file mode 100644 index b1fdabff64..0000000000 --- a/.github/workflows/publish-image.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Publish Docker image - -on: - workflow_dispatch: - inputs: - tags: - description: Image tags - required: false - type: string - workflow_call: - inputs: - tags: - description: Image tags - required: false - type: string - -jobs: - run: - name: Run - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - # Will automatically make nice tags, see the table here https://github.com/docker/metadata-action#basic - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/blockscout/frontend - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Add SHORT_SHA env property with commit short sha - run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - - - name: Debug - env: - REF_TYPE: ${{ github.ref_type }} - REF_NAME: ${{ github.ref_name }} - run: | - echo "ref_type: $REF_TYPE" - echo "ref_name: $REF_NAME" - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - file: ./Dockerfile - push: true - cache-from: type=gha - tags: ${{ inputs.tags || steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - GIT_COMMIT_SHA=${{ env.SHORT_SHA }} - GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index bbb3f07448..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Release - -on: - workflow_dispatch: - release: - types: [ released ] - -jobs: - remove_prerelease_label: - name: Remove pre-release label from issues - runs-on: ubuntu-latest - steps: - - name: Remove label - id: tags - uses: actions/github-script@v6 - env: - LABEL_NAME: pre-release - with: - script: | - const { data: issues } = await github.request('GET /repos/{owner}/{repo}/issues', { - owner: context.repo.owner, - repo: context.repo.repo, - labels: process.env.LABEL_NAME, - state: 'all' - }); - - if (issues.length === 0) { - core.notice(`No issues with label "${ process.env.LABEL_NAME }" found.`); - return; - } - - const issueIds = issues.map(({ node_id }) => node_id); - const labelId = issues[0].labels.find(({ name }) => name === process.env.LABEL_NAME).node_id; - - core.info(`Found ${ issueIds.length } issues with label "${ process.env.LABEL_NAME }"`); - - for (const issueId of issueIds) { - core.info(`Removing label for issue with node_id ${ issueId }...`); - - await github.graphql(` - mutation($input: RemoveLabelsFromLabelableInput!) { - removeLabelsFromLabelable(input: $input) { - clientMutationId - } - } - `, { - input: { - labelIds: [ labelId ], - labelableId: issueId - }, - }); - - core.info('Done.\n'); - } - - - label_released_issues: - name: Label released issues - uses: './.github/workflows/label-issues-in-release.yml' - with: - tag: ${{ github.ref_name }} - label_name: ${{ github.ref_name }} - label_description: Release ${{ github.ref_name }} - secrets: inherit - - update_project_cards: - name: Update project tasks statuses - needs: label_released_issues - uses: './.github/workflows/update-project-cards.yml' - with: - project_name: ${{ vars.PROJECT_NAME }} - field_name: Status - field_value: Released - issues: ${{ needs.label_released_issues.outputs.issues }} - secrets: inherit - - publish_image: - name: Publish Docker image - uses: './.github/workflows/publish-image.yml' - secrets: inherit - - upload_source_maps: - name: Upload source maps to Sentry - needs: publish_image - uses: './.github/workflows/upload-source-maps.yml' - secrets: inherit diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml deleted file mode 100644 index bcc1a36ca1..0000000000 --- a/.github/workflows/stale-issues.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Close inactive issues -on: - schedule: - - cron: "55 1 * * *" - -jobs: - close-issues: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@v5 - with: - # issues - only-issue-labels: "need info" - days-before-issue-stale: 14 - days-before-issue-close: 7 - stale-issue-label: "stale" - stale-issue-message: "This issue is stale because it has been open for 14 days with no activity." - close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale." - - # pull requests - days-before-pr-stale: -1 - days-before-pr-close: -1 - - # other settings - repo-token: ${{ secrets.GITHUB_TOKEN }} - close-issue-reason: "not_planned" \ No newline at end of file diff --git a/.github/workflows/update-project-cards.yml b/.github/workflows/update-project-cards.yml deleted file mode 100644 index 98ffbed2bb..0000000000 --- a/.github/workflows/update-project-cards.yml +++ /dev/null @@ -1,240 +0,0 @@ -name: Update project cards for issues - -on: - workflow_dispatch: - inputs: - project_name: - description: Name of the project - default: Front-end tasks - required: true - type: string - field_name: - description: Field name to be updated - default: Status - required: true - type: string - field_value: - description: New value of the field - default: Released - required: true - type: string - issues: - description: JSON encoded list of issue numbers to be updated - required: true - type: string - workflow_call: - inputs: - project_name: - description: Name of the project - required: true - type: string - field_name: - description: Field name to be updated - required: true - type: string - field_value: - description: New value of the field - required: true - type: string - issues: - description: JSON encoded list of issue numbers to be updated - required: true - type: string - -jobs: - run: - name: Run - runs-on: ubuntu-latest - steps: - - name: Getting project info - id: project_info - uses: actions/github-script@v6 - env: - PROJECT_NAME: ${{ inputs.project_name }} - FIELD_NAME: ${{ inputs.field_name }} - FIELD_VALUE: ${{ inputs.field_value }} - with: - github-token: ${{ secrets.BOT_LABEL_ISSUE_TOKEN }} - script: | - const response = await github.graphql(` - query ($login: String!, $q: String!) { - organization(login: $login) { - projectsV2(query: $q, first: 1) { - nodes { - id, - title, - number, - fields(first: 20) { - nodes { - ... on ProjectV2Field { - id - name - } - ... on ProjectV2SingleSelectField { - id - name - options { - id - name - } - } - } - } - } - } - } - } - `, { - login: context.repo.owner, - q: process.env.PROJECT_NAME, - }); - - const { organization: { projectsV2: { nodes: projects } } } = response; - - if (projects.length === 0) { - core.setFailed('Project not found.'); - return; - } - - if (projects.length > 1) { - core.info(`Fould ${ projects.length } with the similar name:`); - projects.forEach((issue) => { - core.info(` #${ projects.number } - ${ projects.title }`); - }) - core.setFailed('Fould multiple projects with the similar name. Cannot determine which one to use.'); - return; - } - - const { id: projectId, fields: { nodes: fields } } = projects[0]; - const field = fields.find((field) => field.name === process.env.FIELD_NAME); - - if (!field) { - core.setFailed(`Field with name "${ process.env.FIELD_NAME }" not found in the project.`); - return; - } - - const option = field.options.find((option) => option.name === process.env.FIELD_VALUE); - - if (!option) { - core.setFailed(`Option with name "${ process.env.FIELD_VALUE }" not found in the field possible values.`); - return; - } - - core.info('Found following info:'); - core.info(` project_id: ${ projectId }`); - core.info(` field_id: ${ field.id }`); - core.info(` field_value_id: ${ option.id }`); - - core.setOutput('id', projectId); - core.setOutput('field_id', field.id); - core.setOutput('field_value_id', option.id); - - - name: Getting project items that linked to the issues - id: items - uses: actions/github-script@v6 - env: - ISSUES: ${{ inputs.issues }} - with: - github-token: ${{ secrets.BOT_LABEL_ISSUE_TOKEN }} - script: | - const result = []; - const issues = JSON.parse(process.env.ISSUES); - - for (const issue of issues) { - const response = await getProjectItemId(issue); - response?.length > 0 && result.push(...response); - } - - return result; - - async function getProjectItemId(issueId) { - core.info(`Fetching project items for issue #${ issueId }...`); - - try { - const response = await github.graphql(` - query ($owner: String!, $repo: String!, $id: Int!) { - repository(owner: $owner, name: $repo) { - issue(number: $id) { - title, - projectItems(first: 10) { - nodes { - id, - } - } - } - } - } - `, - { - owner: context.repo.owner, - repo: context.repo.repo, - id: issueId, - } - ); - - const { repository: { issue: { projectItems: { nodes: projectItems } } } } = response; - - if (projectItems.length === 0) { - core.info('No project items found.\n'); - return []; - } - - const ids = projectItems.map((item) => item.id); - core.info(`Found [ ${ ids.join(', ') } ].\n`); - return ids; - - } catch (error) { - if (error.status === 404) { - core.info('Nothing has found.\n'); - return []; - } - } - } - - - name: Updating field value of the project items - id: updating_items - uses: actions/github-script@v6 - env: - ITEMS: ${{ steps.items.outputs.result }} - PROJECT_ID: ${{ steps.project_info.outputs.id }} - FIELD_ID: ${{ steps.project_info.outputs.field_id }} - FIELD_VALUE_ID: ${{ steps.project_info.outputs.field_value_id }} - with: - github-token: ${{ secrets.BOT_LABEL_ISSUE_TOKEN }} - script: | - const items = JSON.parse(process.env.ITEMS); - - if (items.length === 0) { - core.info('Nothing to update.'); - core.notice('No project items found for provided issues. Nothing to update.'); - return; - } - - for (const item of items) { - core.info(`Changing field value for item ${ item }...`); - await changeItemFieldValue(item); - core.info('Done.\n'); - } - - async function changeItemFieldValue(itemId) { - return await github.graphql( - ` - mutation($input: UpdateProjectV2ItemFieldValueInput!) { - updateProjectV2ItemFieldValue(input: $input) { - clientMutationId - } - } - `, - { - input: { - projectId: process.env.PROJECT_ID, - fieldId: process.env.FIELD_ID, - itemId, - value: { - singleSelectOptionId: process.env.FIELD_VALUE_ID, - }, - }, - } - ); - }; - diff --git a/.github/workflows/upload-source-maps.yml b/.github/workflows/upload-source-maps.yml deleted file mode 100644 index 0c284672a1..0000000000 --- a/.github/workflows/upload-source-maps.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Upload source maps to Sentry -on: - workflow_call: - workflow_dispatch: - -env: - SENTRY_ORG: ${{ vars.SENTRY_ORG }} - SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - -jobs: - build_and_upload: - name: Build app with source maps and upload to Sentry - runs-on: ubuntu-latest - if: ${{ github.ref_type == 'tag' }} - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v3 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Make production build with source maps - run: yarn build - env: - NODE_ENV: production - - - name: Inject Sentry debug ID - run: yarn sentry-cli sourcemaps inject ./.next - - - name: Upload source maps to Sentry - run: yarn sentry-cli sourcemaps upload --release=${{ github.ref_name }} --url-prefix=~/_next/ --validate ./.next \ No newline at end of file diff --git a/pages/_document.tsx b/pages/_document.tsx index 74ebe08fb5..f70412709c 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -49,7 +49,11 @@ class MyDocument extends Document { - +
diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c2332399fe9833a6f03719d9a93519fe0db551af GIT binary patch literal 21588 zcmZ^~19WD=vo9JGg2Yqbr14}LG@hEJlIWdz&AYvSQz`lb6QA?cI(PsJ
z`6WiFxo$B!qWIyNik3pDj%f2TZFbO5sRK~=MTY8UO3Qra&F}HjXwKtiXZ?v8>|KAK
zm00)uSA 3>KqWApa6#PO
z5Tm(~uAlBsy9Po$hffJTB-ovF#2fUKA4iCDBO$Iys)(kKp3xs(h`#)HGjm~WkI=t0
z