Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tauri #748

Merged
merged 1 commit into from
Mar 16, 2024
Merged

Tauri #748

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
dist
.vscode
build
.eslintrc.cjs
5 changes: 4 additions & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* eslint-env node */
module.exports = {
env: {
node: true,
},
root: true,
extends: [
'eslint:recommended',
Expand All @@ -19,7 +22,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
project: ['./tsconfig.json', './src/*/tsconfig.json'],
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
settings: { react: { version: 'detect' } },
Expand Down
168 changes: 42 additions & 126 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,33 @@ concurrency:

jobs:
qa:
# Let's implement different jobs for Windows and Linux at some point, especially for packaging scripts
runs-on: ubuntu-latest
# For QA (lint, test, etc), Linux is enough
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 20

- name: Display Node.js and npm informations
- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: install dependencies (ubuntu only)
run: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Generate types
run: cargo test --manifest-path src-tauri/Cargo.toml

- name: 'Test: formatting'
run: 'yarn run test:formatting'

- name: 'Test: typings'
run: 'yarn run test:typings'

- name: 'Test: TS/JS linting'
run: 'yarn run test:lint'

Expand All @@ -51,138 +53,52 @@ jobs:
- name: 'Test: unit'
run: 'yarn run test:unit'

- name: 'Test: typings'
run: 'yarn run test:typings'

- name: Build application
run: yarn run build

- uses: actions/upload-artifact@v3
with:
name: application-build
path: dist/
# - uses: actions/upload-artifact@v4
# with:
# name: application-build
# path: dist/

# Documentation on environments:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners

binaries-linux:
runs-on: ubuntu-latest
needs: [qa]
binaries:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 20

- name: Display Node.js and npm informations
run: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"

- uses: actions/download-artifact@v3
with:
name: application-build
path: dist/
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Install Linux dependencies
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt update
sudo apt install --no-install-recommends -y libopenjp2-tools rpm gcc-multilib g++-multilib
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Install dependencies
- name: install frontend dependencies
run: yarn install --frozen-lockfile

- name: Package Linux binaries
# - name: Package Linux/Windows binaries
run: yarn run package:l
# run: yarn run package:lw
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/upload-artifact@v3
with:
name: binaries-linux
path: |
build/museeks-linux-i386.deb
build/museeks-linux-amd64.deb
build/museeks-linux-i386.AppImage
build/museeks-linux-x86_64.AppImage
build/museeks-linux-i686.rpm
build/museeks-linux-x86_64.rpm
build/museeks-linux-x64.tar.gz

binaries-macos:
runs-on: macos-latest
needs: [qa]

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Display Node.js and npm informations
run: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"

- uses: actions/download-artifact@v3
with:
name: application-build
path: dist/

- name: Install production dependencies
run: yarn install --frozen-lockfile

- name: Package macOS binaries
run: yarn run package:m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}

- uses: actions/upload-artifact@v3
with:
name: binaries-macos
path: |
build/museeks-macos-arm64.dmg
build/museeks-macos-x64.dmg

binaries-windows:
runs-on: windows-latest
needs: [qa]

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Display Node.js and npm informations
run: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"

- uses: actions/download-artifact@v3
with:
name: application-build
path: dist/

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Package Windows binaries
run: yarn run package:w
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/upload-artifact@v3
with:
name: binaries-windows
path: |
build/museeks-win-x64-setup.exe
build/museeks-win-x64-portable.exe
includeRelease: false
includeUpdaterJson: false
77 changes: 19 additions & 58 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,26 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock
node_modules
dist
dist-ssr
*.local

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

dist/main/*
dist/renderer/*
dist/preload/*
cache/
build/
.vscode
# Editor directories and files
.vscode/*
!.vscode/extensions.json

.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Generated files
src/generated/typings/*
!src/generated/typings/index.ts
src-tauri/gen
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"csstools.postcss",
"vunguyentuan.vscode-postcss",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint",
"ZixuanChen.vitest-explorer"
"tauri-apps.tauri-vscode",
"rust-lang.rust-analyzer"
]
}
Loading
Loading