Skip to content

Commit

Permalink
build: update tools (#448)
Browse files Browse the repository at this point in the history
* build: migrate to pnpm, esbuild, biome and node:test

* ci: add names

* chore: format GA workflows with prettier

* build: add watch feature

* build: update npm scripts

* build: use esbuild to build json.ts

* fix: remove incorrect calls of svgToDataURL

* chore: add blank lines to build.ts#main()

* build: validate result of require("*.json.cjs")

* chore: update watch.ts

* build: update build script

* chore: migrate from lint-staged and husky to lefthook

* fix: open watch page only once

* chore: update build.ts

* chore: update biome.json

* chore: upgrade packages

* ci: upload build artifacts
  • Loading branch information
iorate authored May 4, 2024
1 parent 924de29 commit 8b71f36
Show file tree
Hide file tree
Showing 183 changed files with 23,310 additions and 28,061 deletions.
File renamed without changes.
66 changes: 0 additions & 66 deletions .eslintrc.js

This file was deleted.

6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
title: ""
labels: ""
assignees: ""
---

## Expected Behavior
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/check-website.yml

This file was deleted.

64 changes: 49 additions & 15 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,69 @@
name: check
name: Check

permissions:
contents: read
pull-requests: read

on:
push:
branches:
- master
paths-ignore:
- website/**
pull_request:
branches:
- master
paths-ignore:
- website/**

jobs:
check:
name: Check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn install --immutable
- run: yarn lint
- run: yarn test
- run: yarn build-all
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Check
run: pnpm check

- name: Test
run: pnpm test

- name: Build
run: |
pnpm build
pnpm build --browser firefox
pnpm build --browser safari
env:
DROPBOX_API_KEY: ${{ secrets.DROPBOX_API_KEY }}
DROPBOX_API_SECRET: ${{ secrets.DROPBOX_API_SECRET }}
GOOGLE_DRIVE_API_KEY: ${{ secrets.GOOGLE_DRIVE_API_KEY }}
GOOGLE_DRIVE_API_SECRET: ${{ secrets.GOOGLE_DRIVE_API_SECRET }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist

- name: "[Website] Get changed files"
id: website-changed-files
uses: tj-actions/changed-files@v44
with:
files: website/**

- name: "[Website] Check"
if: steps.website-changed-files.outputs.any_changed == 'true'
run: pnpm check
working-directory: website

- name: "[Website] Build"
if: steps.website-changed-files.outputs.any_changed == 'true'
run: pnpm build
working-directory: website
41 changes: 0 additions & 41 deletions .github/workflows/deploy-website.yml

This file was deleted.

41 changes: 28 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy
name: Deploy

permissions:
contents: write
Expand All @@ -11,37 +11,52 @@ on:
chrome:
type: boolean
default: true
description: Chrome Web Store
description: Chrome
firefox:
type: boolean
default: true
description: Firefox Add-ons
description: Firefox

jobs:
deploy:
name: Deploy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn install --immutable
- run: yarn build-all
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Build
run: |
pnpm build
pnpm build --browser firefox
env:
DROPBOX_API_KEY: ${{ secrets.DROPBOX_API_KEY }}
DROPBOX_API_SECRET: ${{ secrets.DROPBOX_API_SECRET }}
GOOGLE_DRIVE_API_KEY: ${{ secrets.GOOGLE_DRIVE_API_KEY }}
GOOGLE_DRIVE_API_SECRET: ${{ secrets.GOOGLE_DRIVE_API_SECRET }}
- run: yarn semantic-release

- name: Deploy
run: pnpm semantic-release
env:
# Chrome Web Store
RELEASE_CHROME: ${{ inputs.chrome }}
# Chrome
DEPLOY_CHROME: ${{ inputs.chrome }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
# Firefox Add-ons
RELEASE_FIREFOX: ${{ inputs.firefox }}
# Firefox
DEPLOY_FIREFOX: ${{ inputs.firefox }}
AMO_API_KEY: ${{ secrets.AMO_API_KEY }}
AMO_API_SECRET: ${{ secrets.AMO_API_SECRET }}
DROPBOX_API_KEY: ${{ secrets.DROPBOX_API_KEY }}
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/stale.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "[Website] Deploy"

permissions:
contents: read
id-token: write
pages: write

on:
push:
branches:
- master
paths:
- website/**

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build
working-directory: website

- name: Upload
uses: actions/upload-pages-artifact@v3
with:
path: website/build
deploy:
name: Deploy
runs-on: ubuntu-22.04
needs: build
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Loading

0 comments on commit 8b71f36

Please sign in to comment.