-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This workflow is the entry point for all CI processes. | ||
# It is from here that all other workflows are launched. | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- 'renovate/**' | ||
paths-ignore: | ||
- '.github/**' | ||
- '!.github/workflows/ci.yml' | ||
- '!.github/workflows/typechecking.yml' | ||
- '!.github/workflows/tests.yml' | ||
- '!.github/workflows/release.yml' | ||
- '**.md' | ||
- .editorconfig | ||
- .gitignore | ||
- '.idea/**' | ||
- '.vscode/**' | ||
pull_request: | ||
paths-ignore: | ||
- '.github/**' | ||
- '!.github/workflows/ci.yml' | ||
- '!.github/workflows/typechecking.yml' | ||
- '!.github/workflows/tests.yml' | ||
- '!.github/workflows/release.yml' | ||
- '**.md' | ||
- .editorconfig | ||
- .gitignore | ||
- '.idea/**' | ||
- '.vscode/**' | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
typechecking: | ||
uses: ./.github/workflows/typechecking.yml | ||
tests: | ||
uses: ./.github/workflows/tests.yml | ||
draft_release: | ||
permissions: | ||
contents: write # Allows this job to create releases | ||
with: | ||
dry-run: ${{ github.event_name != 'push' || github.ref_name != 'main' }} | ||
needs: [ typechecking, tests ] | ||
uses: ./.github/workflows/release.yml | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- '**.js' | ||
- '**.mjs' | ||
- '**.cjs' | ||
- '**.jsx' | ||
- '**.ts' | ||
- '**.mts' | ||
- '**.cts' | ||
- '**.tsx' | ||
- '**.vue' | ||
- 'package-lock.json' | ||
pull_request: | ||
paths: | ||
- '**.js' | ||
- '**.mjs' | ||
- '**.cjs' | ||
- '**.jsx' | ||
- '**.ts' | ||
- '**.mts' | ||
- '**.cts' | ||
- '**.tsx' | ||
- '**.vue' | ||
- 'package-lock.json' | ||
|
||
concurrency: | ||
group: lint-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: 'bash' | ||
|
||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
|
||
- run: npm ci | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
|
||
- run: npm run lint --if-present | ||
|
||
# This job just check code style for in-template contributions. | ||
code-style: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
|
||
- run: npm i prettier | ||
- run: npx prettier --check "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Release | ||
on: | ||
workflow_call: | ||
inputs: | ||
dry-run: | ||
description: 'Compiles the app but not upload artifacts to distribution server' | ||
default: false | ||
required: false | ||
type: boolean | ||
|
||
concurrency: | ||
group: release-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
defaults: | ||
run: | ||
shell: 'bash' | ||
|
||
|
||
jobs: | ||
draft_release: | ||
|
||
permissions: | ||
contents: write # Allows this job to create releases | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ macos-latest, ubuntu-latest, windows-latest ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
|
||
- run: npm ci | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
|
||
- run: npm run build | ||
|
||
- name: Compile artifacts ${{ inputs.dry-run && '' || 'and upload them to github release' }} | ||
# I use this action because it is capable of retrying multiple times if there are any issues with the distribution server | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 15 | ||
max_attempts: 6 | ||
retry_wait_seconds: 15 | ||
retry_on: error | ||
shell: 'bash' | ||
# Due to this issue https://github.com/electron-userland/electron-builder/issues/6411 the build with npx when rebuilding native dependencies hangs forever | ||
# see https://github.com/cawa-93/vite-electron-builder/pull/953 | ||
command: ./node_modules/.bin/electron-builder --config electron-builder.yml --publish ${{ inputs.dry-run && 'never' || 'always' }} | ||
env: | ||
# Code Signing params | ||
# See https://www.electron.build/code-signing | ||
# CSC_LINK: '' | ||
# CSC_KEY_PASSWORD: '' | ||
# Publishing artifacts | ||
GH_TOKEN: ${{ secrets.github_token }} # GitHub token, automatically provided (No need to define this secret in the repo settings) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Tests | ||
on: [ workflow_call ] | ||
|
||
concurrency: | ||
group: tests-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: 'bash' | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ windows-latest, ubuntu-latest, macos-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
- run: npm ci | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
- run: npm run test:main --if-present | ||
- run: npm run test:preload --if-present | ||
- run: npm run test:renderer --if-present | ||
|
||
# I ran into problems trying to run an electron window in ubuntu due to a missing graphics server. | ||
# That's why this special command for Ubuntu is here | ||
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e --if-present | ||
if: matrix.os == 'ubuntu-latest' | ||
|
||
- run: npm run test:e2e --if-present | ||
if: matrix.os != 'ubuntu-latest' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Typechecking | ||
on: [ workflow_call ] | ||
|
||
concurrency: | ||
group: typechecking-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: 'bash' | ||
|
||
jobs: | ||
typescript: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
|
||
- run: npm ci | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
|
||
- run: npm run typecheck --if-present |