mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
create secret script & configurations added for Actions
This commit is contained in:
parent
c4c9fd7ac2
commit
b090816bfd
3
.github/workflows/flutter-build.yml
vendored
3
.github/workflows/flutter-build.yml
vendored
@ -16,6 +16,7 @@ jobs:
|
|||||||
- run: |
|
- run: |
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make libwebkit2gtk-4.0-dev keybinder-3.0 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
|
sudo apt-get install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make libwebkit2gtk-4.0-dev keybinder-3.0 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
|
||||||
|
- run: dart bin/create-secrets.dart
|
||||||
- run: flutter config --enable-linux-desktop
|
- run: flutter config --enable-linux-desktop
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
- run: flutter clean
|
- run: flutter clean
|
||||||
@ -40,6 +41,7 @@ jobs:
|
|||||||
- uses: subosito/flutter-action@v2.2.0
|
- uses: subosito/flutter-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
cache: true
|
cache: true
|
||||||
|
- run: dart bin/create-secrets.dart
|
||||||
- run: flutter config --enable-windows-desktop
|
- run: flutter config --enable-windows-desktop
|
||||||
- run: flutter build windows
|
- run: flutter build windows
|
||||||
- run: choco install make -y
|
- run: choco install make -y
|
||||||
@ -59,6 +61,7 @@ jobs:
|
|||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
cache: true
|
cache: true
|
||||||
|
- run: dart bin/create-secrets.dart
|
||||||
- run: flutter config --enable-macos-desktop
|
- run: flutter config --enable-macos-desktop
|
||||||
- run: flutter build macos
|
- run: flutter build macos
|
||||||
- run: du -sh build/macos/Build/Products/Release/spotube.app
|
- run: du -sh build/macos/Build/Products/Release/spotube.app
|
||||||
|
8
.gitignore
vendored
8
.gitignore
vendored
@ -63,4 +63,10 @@ app.*.map.json
|
|||||||
/iscc
|
/iscc
|
||||||
installer.exe
|
installer.exe
|
||||||
|
|
||||||
/choco-struct/tools/*.exe
|
/choco-struct/tools/*.exe
|
||||||
|
|
||||||
|
# secrets
|
||||||
|
*.env
|
||||||
|
lib/models/generated_secrets.dart
|
||||||
|
help.txt
|
||||||
|
secrets.json
|
19
bin/create-secrets.dart
Normal file
19
bin/create-secrets.dart
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:path/path.dart' as path;
|
||||||
|
import 'package:dotenv/dotenv.dart';
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
load();
|
||||||
|
final bool hasKey = env.containsKey("SECRET");
|
||||||
|
final val = hasKey ? jsonDecode(env["SECRET"]!) : null;
|
||||||
|
if (!hasKey || (hasKey && val is! Map && val is! List)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await File(path.join(
|
||||||
|
Directory.current.path, "lib/models/generated_secrets.dart"))
|
||||||
|
.writeAsString(
|
||||||
|
"final List<Map<String, dynamic>> secrets = ${env["SECRET"]};");
|
||||||
|
}
|
@ -148,6 +148,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
|
dotenv:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: dotenv
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -67,6 +67,7 @@ dev_dependencies:
|
|||||||
# package. See that file for information about deactivating specific lint
|
# package. See that file for information about deactivating specific lint
|
||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
flutter_lints: ^1.0.0
|
flutter_lints: ^1.0.0
|
||||||
|
dotenv: ^3.0.0
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
Loading…
Reference in New Issue
Block a user