Skip to content

Commit

Permalink
Merge pull request #19 from gizmo-ds/refactor/installer-next
Browse files Browse the repository at this point in the history
refactor: installer-next
  • Loading branch information
gizmo-ds authored Apr 9, 2024
2 parents ee2fb01 + 102ca68 commit f27fea6
Show file tree
Hide file tree
Showing 20 changed files with 409 additions and 364 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags: [v*]
branches: [main]
pull_request:

permissions:
contents: write
Expand All @@ -15,27 +16,29 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'

- run: corepack enable
- uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.11.1
cache: pnpm
- run: pnpm install
- name: Install dependencies
run: pnpm install

- name: Install esbuild
run: |
curl -fsSL https://esbuild.github.io/dl/latest | sh
mv esbuild $HOME/go/bin
- name: Install linker
shell: bash
run: sudo apt-get install -y mingw-w64

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-pc-windows-gnu

- name: Build
- name: Build release
run: make

- name: Release
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules
build
test-data
.env.local
.vscode/*
!.vscode/extensions.json
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
"esbenp.prettier-vscode"
]
}
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ build-patch-loader:
@rm -rf build/*.css

build-installer: build-patch-loader
@cp build/patch-loader.js cmd/installer/patch-loader.js
@GOOS=windows CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o build/vcc-auto-translate-installer.exe cmd/installer/main.go
@cp build/patch-loader.js installer-src/assets/patch-loader.js
@cd installer-src && cargo build --release --locked --target x86_64-pc-windows-gnu
@cp installer-src/target/x86_64-pc-windows-gnu/release/vcc-auto-translate-installer.exe build/vcc-auto-translate-installer.exe

sha256sum:
@rm -f build/*.sha256; for file in build/*; do sha256sum $$file > $$file.sha256; done
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ VCC(VRChat Creator Companion) 的翻译脚本, 用于自动翻译 VCC 的界面.

环境要求:

- [Go 1.20+](https://go.dev/doc/install)
- [node + package manager](https://nodejs.org/) / [bun](https://bun.sh/)
- [Rust](https://www.rust-lang.org/)
- [Node.js + package manager](https://nodejs.org/) / [bun](https://bun.sh/)
- [make](https://duckduckgo.com/?q=make+install) (可选)
- [upx](https://github.com/upx/upx/releases/latest) (可选)

Expand All @@ -48,11 +48,13 @@ VCC(VRChat Creator Companion) 的翻译脚本, 用于自动翻译 VCC 的界面.
```shell
pnpm install
pnpm run build:patch-loader
Copy-Item build/patch-loader.js cmd/installer/patch-loader.js
$env:CGO_ENABLED=0
go build -trimpath -ldflags "-s -w" -o build/vcc-auto-translate-installer.exe cmd/installer/main.go
Copy-Item build/patch-loader.js installer-src/assets/patch-loader.js
cd installer-src
cargo build --release --locked
```

编译完成后, 你可以在`installer-src/target/release`目录找到编译好的自动安装工具.

## Related

- [VRChat-Creator-Companion-zh-CN](https://github.com/Sonic853/VRChat-Creator-Companion-zh-CN) - This project was
Expand Down
2 changes: 0 additions & 2 deletions cmd/installer/.gitignore

This file was deleted.

120 changes: 0 additions & 120 deletions cmd/installer/main.go

This file was deleted.

38 changes: 0 additions & 38 deletions cmd/installer/utils/file.go

This file was deleted.

67 changes: 0 additions & 67 deletions cmd/installer/utils/i18n.go

This file was deleted.

13 changes: 0 additions & 13 deletions cmd/installer/utils/vcc_notwindows.go

This file was deleted.

34 changes: 0 additions & 34 deletions cmd/installer/utils/vcc_windows.go

This file was deleted.

14 changes: 0 additions & 14 deletions go.mod

This file was deleted.

Loading

0 comments on commit f27fea6

Please sign in to comment.