Skip to content

Commit

Permalink
feat: development requirement file setting
Browse files Browse the repository at this point in the history
  • Loading branch information
abc873693 committed Sep 3, 2024
1 parent 49da0fd commit af4591f
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
with:
flutter-version: '3.24.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- name: Install Flutter dependencies
run: flutter pub get
- run: flutter build appbundle --release
Expand Down Expand Up @@ -73,6 +77,10 @@ jobs:
with:
flutter-version: '3.24.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- run: flutter pub get
- run: flutter build ios --release --no-codesign
- uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -132,6 +140,10 @@ jobs:
with:
flutter-version: '3.24.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- name: Enable windows
run: flutter config --enable-windows-desktop
- run: flutter doctor -v
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- run: flutter pub get
- name: Build Android app bundle
run: flutter build appbundle --release
Expand Down Expand Up @@ -78,6 +82,10 @@ jobs:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- run: flutter pub get
- name: Build iOS
run: flutter build ios --release --no-codesign
Expand Down Expand Up @@ -128,6 +136,10 @@ jobs:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- name: Intall requird Dependencies
run: sudo apt -y install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
- name: Enable linux
Expand All @@ -150,6 +162,10 @@ jobs:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- name: Enable windows
run: flutter config --enable-windows-desktop
- run: flutter doctor -v
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ google-services.json
key.jks
service_account_key.json
android/android_keys.zip
dev_configs.zip
lib/firebase_options.dart

.vscode/

Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

- [X] [Android](https://play.google.com/store/apps/details?id=com.kuas.ap&hl=zh_TW)
- [X] [iOS](https://itunes.apple.com/us/app/id1439751462)
- [X] [Web](https://nkust-ap-flutter.web.app)
- [X] [Windows(Beta)](https://github.com/NKUST-ITC/NKUST-AP-Flutter/releases/download/v3.8.5/nkust_ap_windows.zip)
- [X] [MacOS](https://itunes.apple.com/us/app/id1439751462)
- [X] [Linux(Beta)](https://snapcraft.io/nkust-ap)
- [ ] [Web](https://nkust-ap-flutter.web.app)
- [X] [Windows(目前無法使用因為目前 TFLite 套件不支援 桌面版)](https://github.com/NKUST-ITC/NKUST-AP-Flutter/releases/download/v3.8.5/nkust_ap_windows.zip)
- [X] [MacOS(目前無法使用因為目前 TFLite 套件不支援 桌面版)](https://itunes.apple.com/us/app/id1439751462)
- [X] [Linux(目前無法使用因為目前 TFLite 套件不支援 桌面版)](https://snapcraft.io/nkust-ap)

### Web 版本自7月起因為學校阻擋高請求IP,改為客戶端爬蟲,因此暫時無法使用

Expand All @@ -30,7 +30,22 @@
- [NKUST API](https://github.com/NKUST-ITC/NKUST-AP-API) :
高科校務通後端HTTP RESTful API,代為App處理所有爬蟲問題

## 步驟
## 開發事前需求

### 開發需安裝工具

- GPG

### 解密開發所需檔案

`$DEV_CONFIGS_PASSPHRASE` 替換成正確的密碼

```bash
gpg --quiet --batch --yes --decrypt --passphrase="$DEV_CONFIGS_PASSPHRASE" \
--output dev_configs.zip dev_configs.zip.gpg && sh scripts/unzip_dev_configs.sh
```

## 如何貢獻
1. `Fork` 此專案到你的 GitHub 帳號.
2. 挑選一個你想解決的 [issue](https://github.com/NKUST-ITC/NKUST-AP-Flutter/issues).
3. 創建一個分支(Branch)以該問題命名.
Expand Down
Binary file added dev_configs.zip.gpg
Binary file not shown.
6 changes: 6 additions & 0 deletions scripts/decrypt_dev_configs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# --batch to prevent interactive command
# --yes to assume "yes" for questions
gpg --quiet --batch --yes --decrypt --passphrase="$DEV_CONFIGS_PASSPHRASE" \
--output dev_configs.zip dev_configs.zip.gpg && sh scripts/unzip_dev_configs.sh
4 changes: 4 additions & 0 deletions scripts/encrypt_dev_configs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

sh scripts/zip_dev_configs.sh
gpg --symmetric --cipher-algo AES256 dev_configs.zip
3 changes: 3 additions & 0 deletions scripts/unzip_dev_configs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

jar xvf dev_configs.zip
7 changes: 7 additions & 0 deletions scripts/zip_dev_configs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

zip -r dev_configs.zip \
lib/firebase_options.dart \
android/app/google-services.json \
ios/Runner/GoogleService-Info.plist \
macos/Runner/GoogleService-Info.plist

0 comments on commit af4591f

Please sign in to comment.