diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..2d1b4ee --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,14 @@ +name: "Setup" +description: "Setup and install dependencies" + +runs: + using: "composite" + steps: + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - shell: bash + run: npm ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ee29983 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +jobs: + typecheck: + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - name: Run TypeScript compiler + run: npm run typecheck + + lint: + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - name: Run Eslint + run: npm run lint:check + + format: + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - name: Run Prettier + run: npm run format:check diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml deleted file mode 100644 index d306474..0000000 --- a/.github/workflows/typescript.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Static Analysis -on: - push: - branches: - - master - pull_request: - branches: - - master -jobs: - Typing-and-Linting: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: "20" - - name: Install dependencies - run: npm install - - name: Run TypeScript compiler - run: npm run typecheck - - name: Run Eslint check - run: npm run lint:check diff --git a/build/notarize.js b/build/notarize.js index 72cb254..fedd26f 100644 --- a/build/notarize.js +++ b/build/notarize.js @@ -2,7 +2,7 @@ import { notarize } from "@electron/notarize"; export default async (context) => { if (process.platform !== "darwin") return; - + console.log("aftersign hook triggered, start to notarize app."); if (!process.env.CI) { diff --git a/src/main/index.ts b/src/main/index.ts index b3cba6d..e2e79ac 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -12,17 +12,16 @@ async function createWindow() { const [width, height] = getBounds(); function getIcon(): string { - if (process.platform === 'win32') { - return join(__dirname, '../../build/icon.ico'); + if (process.platform === "win32") { + return join(__dirname, "../../build/icon.ico"); } - - if (process.platform === 'darwin') { - return join(__dirname, '../../build/icon.icns'); - } - - return join(__dirname, '../../build/icon.png'); - } + if (process.platform === "darwin") { + return join(__dirname, "../../build/icon.icns"); + } + + return join(__dirname, "../../build/icon.png"); + } const window = new BrowserWindow({ title: "osu!radio",