new: add version draft
This commit is contained in:
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -31,6 +31,8 @@ env:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
outputs:
|
||||
draftBuildCode: ${{ steps.draftBuildCode.outputs.datetime }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -44,6 +46,11 @@ jobs:
|
||||
- name: Test
|
||||
run: flutter test
|
||||
|
||||
- name: make draftBuildCode
|
||||
id: draftBuildCode
|
||||
run: echo "::set-output name=datetime::$(date +'%m-%dT%H-%M')"
|
||||
|
||||
|
||||
build:
|
||||
needs: test
|
||||
permissions: write-all
|
||||
@@ -78,6 +85,11 @@ jobs:
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: update draft version
|
||||
if: ${{ inputs.upload-artifact && inputs.tag-name == 'draft' }}
|
||||
run: |
|
||||
draftBuildCode="${{ needs.test.outputs.draftBuildCode }}"
|
||||
sed -i "0,/version: [0-9.]*+/{s/version: [0-9.]*+/version: $draftBuildCode/}" pubspec.yml
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
|
||||
@@ -132,18 +132,9 @@ Future<void> lazyBootstrap(
|
||||
"profile repository",
|
||||
() => container.read(profileRepositoryProvider.future),
|
||||
);
|
||||
Logger.bootstrap.info("Starting Singbox Service Provider");
|
||||
await _init(
|
||||
"sing-box",
|
||||
() => container.read(singboxServiceProvider).init(),
|
||||
);
|
||||
|
||||
Logger.bootstrap.info("Starting Active Profile");
|
||||
// await _safeInit(
|
||||
// "active profile",
|
||||
// () => container.read(activeProfileProvider.future),
|
||||
// timeout: 1000,
|
||||
// );
|
||||
await _init(
|
||||
await _safeInit(
|
||||
"active profile",
|
||||
() => container.read(activeProfileProvider.future),
|
||||
timeout: 1000,
|
||||
@@ -154,7 +145,11 @@ Future<void> lazyBootstrap(
|
||||
() => container.read(deepLinkNotifierProvider.future),
|
||||
timeout: 1000,
|
||||
);
|
||||
|
||||
Logger.bootstrap.info("Starting Singbox Service Provider");
|
||||
await _init(
|
||||
"sing-box",
|
||||
() => container.read(singboxServiceProvider).init(),
|
||||
);
|
||||
if (PlatformUtils.isDesktop) {
|
||||
Logger.bootstrap.info("Starting System Tray");
|
||||
await _safeInit(
|
||||
@@ -202,7 +197,7 @@ Future<T> _init<T>(
|
||||
try {
|
||||
final result = await func();
|
||||
Logger.bootstrap.debug(
|
||||
"[$name] initialized in ${stopWatch.elapsedMilliseconds}ms ${result}");
|
||||
"[$name] initialized in ${stopWatch.elapsedMilliseconds}ms $result");
|
||||
return result;
|
||||
} catch (e, stackTrace) {
|
||||
Logger.bootstrap.error("[$name] error initializing", e, stackTrace);
|
||||
@@ -219,7 +214,7 @@ Future<T?> _safeInit<T>(
|
||||
}) async {
|
||||
try {
|
||||
return await _init(name, initializer, timeout: timeout);
|
||||
} catch (_) {
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user