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