Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Borber committed Nov 23, 2023
0 parents commit 52bddc0
Show file tree
Hide file tree
Showing 73 changed files with 10,983 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"es2021": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "solid", "simple-import-sort"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:solid/typescript"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"ignorePatterns": ["src/assets", "src/css", "src/*.css"],
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
}
}
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: cargo
directory: /src-tauri
schedule:
interval: daily
- package-ecosystem: npm
directory: /
schedule:
interval: daily
101 changes: 101 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: "Release"

permissions:
contents: write

on:
push:
tags:
- v.*

jobs:
changelog:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changelog_reader.outputs.changes }}
version: ${{ steps.changelog_reader.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
- name: Get version number
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION/v./}
echo "::set-output name=version::$VERSION"
- name: Changelog Reader
id: changelog_reader
uses: mindsers/changelog-reader-action@v2.2.2
with:
path: "CHANGELOG.md"
version: ${{ steps.get_version.outputs.version }}

build:
needs: changelog
outputs:
release_id: ${{ steps.action_gh_release.outputs.id }}
strategy:
fail-fast: false
matrix:
lang: [zh_en, zh_jp]
platform: [macos-latest, ubuntu-latest, windows-latest]

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

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly

- name: Install dependencies (windows only)
if: matrix.platform == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install frontend dependencies
run: pnpm install

- name: Install deno
uses: denoland/setup-deno@v1
with:
deno-version: canary

- name: Confirm language
env:
MATRIX_LANG: ${{ matrix.lang }}
run: deno run -A script/lang.ts

- name: Build
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Built
env:
MATRIX_LANG: ${{ matrix.lang }}
run: deno run -A script/built.ts

- name: Upload release assets
id: action_gh_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Tran ${{ needs.changelog.outputs.version }}
body: |
${{ needs.changelog.outputs.changes }}
files: release/*
draft: true
prerelease: false
37 changes: 37 additions & 0 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Test build"
on: [pull_request]

jobs:
test-tauri:
strategy:
fail-fast: true
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- name: Install dependencies (windows only)
if: matrix.platform == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install frontend dependencies
run: pnpm install
- name: Build
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
.vscode
7 changes: 7 additions & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
semi = false
tabWidth = 4

[[overrides]]
files = "*.yml"
[overrides.options]
tabWidth = 2 #缩进字节数
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

## [0.1.1]

<div align="center">

| **To \ Form** | **CN** |
| :-----------: | :----: |
| **EN** ||
| **JP** ||

</div>

如有 Bug,请提 issue
Loading

0 comments on commit 52bddc0

Please sign in to comment.