-
Notifications
You must be signed in to change notification settings - Fork 2
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
小滋润
committed
Oct 29, 2024
1 parent
0e337a5
commit 4f636f5
Showing
321 changed files
with
11,889 additions
and
7,045 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,51 @@ | ||
# Dart & Flutter 的生成文件和缓存 | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
build/ | ||
ios/Flutter/Flutter.framework | ||
ios/Flutter/Flutter.podspec | ||
ios/Pods/ | ||
ios/.symlinks/ | ||
ios/Flutter/Generated.xcconfig | ||
pubspec.lock | ||
|
||
# iOS 的构建输出 | ||
ios/Runner.xcworkspace/ | ||
ios/build/ | ||
ios/DerivedData/ | ||
|
||
# Android 的构建输出 | ||
android/.gradle/ | ||
android/app/build/ | ||
android/local.properties | ||
android/.idea/ | ||
|
||
# MacOS 的构建输出 | ||
macos/Flutter/ephemeral/ | ||
macos/build/ | ||
|
||
# Windows 的构建输出 | ||
windows/flutter/ephemeral/ | ||
windows/build/ | ||
|
||
# Linux 的构建输出 | ||
linux/flutter/ephemeral/ | ||
linux/build/ | ||
|
||
# Web 构建输出 | ||
web/compile/ | ||
web/generated_plugin_registrant.dart | ||
|
||
# 临时文件 | ||
*.log | ||
*.tmp | ||
*.swp | ||
*.lock | ||
*.bak | ||
|
||
# Version control system | ||
.git/ | ||
|
||
service/ |
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,69 @@ | ||
name: Create Release | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
release_name: | ||
required: true | ||
type: string | ||
server_host: | ||
required: true | ||
type: string | ||
server_port: | ||
required: true | ||
type: string | ||
|
||
secrets: | ||
SERVER_SIGN_KEY: | ||
required: true | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: 3.24.1 | ||
|
||
- name: Run flutter doctor | ||
run: flutter doctor | ||
|
||
- name: Build APK | ||
run: | | ||
flutter build apk --release \ | ||
--dart-define=config.server.network.host=${{ inputs.server_host }} \ | ||
--dart-define=config.server.network.port=${{ inputs.server_port }} \ | ||
--dart-define=config.server.signKey=${{ secrets.SERVER_SIGN_KEY }} | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ inputs.tag }} | ||
release_name: ${{ inputs.release_name }} | ||
draft: true | ||
prerelease: false | ||
|
||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
file: build/app/outputs/flutter-apk/app-release.apk | ||
asset_name: LeapLedger.apk | ||
tag: ${{ inputs.tag }} | ||
overwrite: true |
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,35 @@ | ||
name: Push Image | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
|
||
secrets: | ||
DOCKER_HUB_USERNAME: | ||
required: true | ||
DOCKER_HUB_ACCESS_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
push-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: docker/Dockerfile | ||
push: true | ||
tags: xiaozirun/leap-ledger-app:${{ inputs.tag }} |
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,43 @@ | ||
name: Develop Build | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: 3.24.1 | ||
|
||
- name: Run flutter doctor | ||
run: flutter doctor | ||
|
||
- name: Run flutter clean | ||
run: flutter clean | ||
|
||
- name: Build APK | ||
run: | | ||
flutter build apk --release \ | ||
--dart-define=config.server.network.host=${{ vars.SERVER_HOST }} \ | ||
--dart-define=config.server.network.port=${{ vars.SERVER_PORT }} \ | ||
--dart-define=config.server.signKey=${{ secrets.SERVER_SIGN_KEY }} | ||
- name: Upload APK | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: LeapLedger.apk | ||
path: build/app/outputs/flutter-apk/app-release.apk |
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,17 @@ | ||
name: Push Tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
create-release: | ||
uses: ./.github/workflows/common-create-release.yml | ||
with: | ||
tag: ${{ github.ref_name }} | ||
release_name: ${{ github.ref_name }} | ||
server_host: ${{ vars.SERVER_HOST }} | ||
server_port: ${{ vars.SERVER_PORT }} | ||
secrets: | ||
SERVER_SIGN_KEY: ${{ secrets.SERVER_SIGN_KEY }} |
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
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 |
---|---|---|
@@ -1,16 +1,109 @@ | ||
# keepaccount_app | ||
![GitHub License](https://img.shields.io/github/license/ZiRunHua/LeapLedger-App) | ||
![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/ZiRunHua/LeapLedger-App/total) | ||
![GitHub stars](https://img.shields.io/github/stars/ZiRunHua/LeapLedger-App?style=social) | ||
![GitHub Release](https://img.shields.io/github/v/release/ZiRunHua/LeapLedger-App) | ||
|
||
A new Flutter project. | ||
# LeapLedger-App | ||
`LeapLedger`是一个的前后端分离的免费开源的记账软件,基于`flutter`带来丝滑流畅的使用体验,在未来轻松扩展至iOS、Mac和Windows。 | ||
|
||
## Getting Started | ||
这是`LeapLedger`的客户端部分,更多的介绍内容请浏览:https://github.com/ZiRunHua/LeapLedger | ||
## 服务端 | ||
Gin服务端项目传送:https://github.com/ZiRunHua/LeapLedger | ||
|
||
This project is a starting point for a Flutter application. | ||
## 开发 | ||
如果你只想使用Docker构建安装包请[跳转](#docker) | ||
|
||
A few resources to get you started if this is your first Flutter project: | ||
1. 检查flutter环境 | ||
```bash | ||
flutter doctor -v | ||
``` | ||
2. 克隆项目 | ||
```bash | ||
git clone https://github.com/ZiRunHua/LeapLedger-App.git leap_ledger_app | ||
``` | ||
3. 新建./.vscode/launch.json文件 | ||
新建./.vscode/launch.json文件,复制一下内容并设置`host` | ||
```json | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "LeapLedger-App", | ||
"request": "launch", | ||
"type": "dart", | ||
"args": [ | ||
"--dart-define=config.server.network.host=", | ||
"--dart-define=config.server.network.port=8080", | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
4. 启动API服务 | ||
|
||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) | ||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) | ||
我们提供了启动后端服务器的脚本,该脚本会自动寻找当前客户端版本对应的最新可用的后端`docker`镜像,并执行启动命令 | ||
|
||
For help getting started with Flutter development, view the | ||
[online documentation](https://docs.flutter.dev/), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. | ||
API服务依赖[Docker](#https://www.docker.com),请确保你安装了它 | ||
```bash | ||
docker --version | ||
``` | ||
- window | ||
|
||
PowerShell脚本,如果命令的执行出现问题,请在“文件管理器”中右键点击start.ps1,选择“使用PowerSheel运行” | ||
```bash | ||
cd service | ||
.\start.ps1 | ||
``` | ||
|
||
- linux/mac | ||
```bash | ||
cd service | ||
./start | ||
``` | ||
|
||
如果以上方式都没能启动API服务,不用担心,你可以直接`git clone`服务端项目,然后切换到对应版本后运行。 | ||
|
||
传送门:https://github.com/ZiRunHua/LeapLedger | ||
|
||
启动完成后,你可以通过访问以下 URL 来验证 API 服务是否正常运行: | ||
|
||
http://localhost:8080/public/health | ||
|
||
5. API文档 | ||
采用了RESTful API设计风格,提供了多种形式的API文档 | ||
|
||
- [ApiFox 接口文档](https://apifox.com/apidoc/shared-df940a71-63e8-4af7-9090-1be77ba5c3df) | ||
- 如果通过脚本启动 API 服务,你也可以在 `./service/docs` 目录下查看 API 文档。 | ||
- API 服务还提供了在线的 API 文档访问页面:[http://localhost:8080/public/swagger/index.html](http://localhost:8080/public/swagger/index.html) | ||
## 构建安装包 | ||
|
||
如果你已经配置好了 Flutter 开发环境,可以使用以下命令来构建 APK 文件。 | ||
|
||
请将 `<ip>` 替换为你主机的 IP 地址,端口默认为 `8080`,可以不做修改。 | ||
```bash | ||
flutter build apk --release --dart-define=config.server.network.host=<ip> --dart-define=config.server.network.port=8080 | ||
``` | ||
### Docker | ||
使用docker构建请在根目录下新建.env文件,并设置 IP 地址 | ||
``` | ||
# 服务器地址 | ||
SERVER_HOST="" | ||
# 服务器端口 | ||
SERVER_PORT="8080" | ||
# 服务端接口签名对称秘钥 可选 | ||
# SERVER_SIGN_KEY="" | ||
``` | ||
执行以下命令来启动构建过程。构建过程可能需要几分钟时间,具体取决于你的系统性能。如果你对 Android 开发有一定了解,可以通过挂载本地的 Gradle 路径来加速构建过程。 | ||
```bash | ||
docker-compose up --build build_apk | ||
``` | ||
构建完成后,请检查`./docker/build`目录以查看生成的 APK 文件。 | ||
|
||
|
||
## 我们需要你 | ||
LeapLedger项目仍在初期开发阶段,许多功能和细节还在不断完善中。如果你有任何需求和建议欢迎提交`issues`,如果你对LeapLedger感兴趣欢迎体提交`pull request`,期待你的加入。 | ||
|
||
我们会在develop分支进行功能开发和调整,而main分支则用于发布稳定版本。 | ||
|
||
|
||
[![Stargazers over time](https://starchart.cc/ZiRunHua/LeapLedger-App.svg)](https://starchart.cc/ZiRunHua/LeapLedger-App) |
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
Oops, something went wrong.