build(deps): Bump deps #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
paths-ignore: | |
- '.devcontainer/**' | |
- '.vscode/**' | |
- '**.md' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '.devcontainer/**' | |
- '.vscode/**' | |
- '**.md' | |
workflow_dispatch: | |
permissions: read-all | |
jobs: | |
lint-and-test: | |
name: Lint and Test | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up PNPM | |
uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Install PNPM deps | |
run: pnpm install | |
- name: Extra cache for Puppeteer deps | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/puppeteer | |
key: ${{ runner.os }}-puppeteer-${{ hashFiles('pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-puppeteer- | |
- name: Lint code | |
run: pnpm exec eslint . | |
- name: Run type checks | |
run: pnpm exec tsc --noEmit | |
- name: Run tests | |
run: pnpm run test | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false | |
files: coverage/clover.xml | |
flags: unit | |
- name: Run end-to-end tests | |
run: | | |
pnpm run build | |
pnpm run e2e | |
build-and-release: | |
name: Build and Release | |
needs: lint-and-test | |
runs-on: ubuntu-latest | |
if: startswith(github.ref, 'refs/tags/v') # For v* tags | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up PNPM | |
uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Install PNPM deps | |
run: pnpm install | |
- name: Build extension | |
run: pnpm run build | |
- name: Create an archive | |
run: zip -r raindrop-sync-for-chrome.zip dist | |
# NOTE: `CRX_PRIVATE_KEY` secret may differ from environments for security reason; e.g. Dependabot PR | |
- name: Pack extension | |
env: | |
CRX_PRIVATE_KEY: ${{ secrets.CRX_PRIVATE_KEY }} | |
run: node ./scripts/pack-crx.cjs | |
- name: Release extension | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
raindrop-sync-for-chrome.zip | |
raindrop-sync-for-chrome.crx | |
generate_release_notes: true |