From 2fcd7827537b69860ceb11fb49e85864b5c001bb Mon Sep 17 00:00:00 2001 From: formysister Date: Fri, 15 Mar 2024 06:37:27 +0900 Subject: [PATCH] publish: github action activated --- .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE/bug-report.md | 22 ++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 +++ .github/ISSUE_TEMPLATE/feature-request.md | 19 +++++++++ .github/actions/setup/action.yml | 21 ++++++++++ .github/dependabot.yml | 13 ++++++ .github/workflows/conventional-commit.yaml | 16 +++++++ .github/workflows/release.yaml | 46 ++++++++++++++++++++ .github/workflows/test.yaml | 49 ++++++++++++++++++++++ package.json | 8 ++-- 10 files changed, 196 insertions(+), 4 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.md create mode 100644 .github/actions/setup/action.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/conventional-commit.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..12f4900 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +@uniswap/web-reviewers \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..76fff4b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,22 @@ +--- +name: Bug Report +about: Describe the issue +title: '' +labels: bug +assignees: '' +--- + +**Bug Description** +A clear and concise description of the bug. + +**Steps to Reproduce** + +1. Go to ... +2. Click on ... + ... + +**Expected Behavior** +A clear and concise description of what you expected to happen. + +**Additional Context** +Add any other context about the problem here (screenshots, whether the bug only occurs only in certain mobile/desktop/browser environments, etc.) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..e2c6c2c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Support + url: https://discord.gg/FCfyBSbCU5 + about: Please ask and answer questions here diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..49968b6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,19 @@ +--- +name: Feature Request +about: Suggest an idea for improving the UX +title: '' +labels: 'improvement' +assignees: '' +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..9ff0ccc --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,21 @@ +name: Setup +runs: + using: composite + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org + cache: yarn + + - uses: actions/cache@v3 + id: install-cache + with: + path: node_modules/ + key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }} + + - if: steps.install-cache.outputs.cache-hit != 'true' + run: yarn install --frozen-lockfile --ignore-scripts + shell: bash diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..fab801a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: npm + # Files stored in repository root + directory: '/' + schedule: + interval: 'daily' + allow: + - dependency-name: '@uniswap/token-lists' + - dependency-name: '@uniswap/default-token-list' + - dependency-name: '@uniswap/redux-multicall' + # reviewers: + # - 'Uniswap/dependabot-reviewers' diff --git a/.github/workflows/conventional-commit.yaml b/.github/workflows/conventional-commit.yaml new file mode 100644 index 0000000..972358f --- /dev/null +++ b/.github/workflows/conventional-commit.yaml @@ -0,0 +1,16 @@ +name: Conventional commit + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + check-pr-title: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v3.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..7a3539d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,46 @@ +name: Release + +on: + push: + branches: + - main + # manual trigger + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + environment: production + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - run: yarn prepare + + - run: yarn prei18n:compile + # - uses: crowdin/github-action@1.4.8 + # with: + # upload_sources: true + # download_translations: true + # create_pull_request: false + # push_translations: false + # localization_branch_name: main + # source: 'src/locales/en-US.po' + # translation: 'src/locales/%locale%.po' + # crowdin_branch_name: widgets + # token: ${{ secrets.CROWDIN_TOKEN }} + # project_id: 458284 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: yarn i18n:compile + + - run: yarn test + if: success() + env: + JSON_RPC_PROVIDER: ${{ secrets.JSON_RPC_PROVIDER }} + + - run: yarn release + if: success() + env: + NPM_CONFIG_USERCONFIG: /dev/null + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..7d98461 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,49 @@ +name: Test + +on: + pull_request: + branches: + - main + # manual trigger + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - run: yarn prepare + + - run: yarn lint + + deps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - run: yarn yarn-deduplicate --strategy=highest --list --fail + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - run: yarn prepare + + - run: yarn test + env: + JSON_RPC_PROVIDER: ${{ secrets.JSON_RPC_PROVIDER }} + + - run: yarn test:e2e + env: + JSON_RPC_PROVIDER: ${{ secrets.JSON_RPC_PROVIDER }} + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - run: yarn prepare + + - run: yarn build diff --git a/package.json b/package.json index 0cf997d..df79014 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "@uniswap/widgets", - "description": "Uniswap Interface", - "homepage": "https://github.com/Uniswap/widgets#readme", - "repository": "https://github.com/Uniswap/widgets", + "name": "uniswap-widget", + "description": "Uniswap Interface Extension Version", + "homepage": "https://github.com/formysister/uniswap-widget#readme", + "repository": "https://github.com/formysister/uniswap-widget", "files": [ "dist" ],