Skip to content

Commit b719441

Browse files
authored
Releases/v0.7.0 (#92)
* add system information into user agent * now we could try uc query from multiple domains * add ci * more platforms for ci test cases * add region / endpoints class * add query * add accelerateUploading * transregional * fix all test cases * update changelog * now it can prevent from malicious response * follow the comments * fix typo in verson-check script
1 parent 5c1bfe2 commit b719441

36 files changed

+1848
-359
lines changed

.github/workflows/base.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@ on: [push, pull_request]
88

99
jobs:
1010
base:
11-
runs-on: ubuntu-latest
1211
strategy:
1312
fail-fast: false
13+
max-parallel: 1
1414
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
1516
sdk: [3.0, 3.1, 3.2, 3.3, 3.4, stable]
17+
exclude:
18+
- os: windows-latest
19+
sdk: 3.4
20+
runs-on: ${{ matrix.os }}
1621
defaults:
1722
run:
1823
working-directory: ./base
1924
steps:
20-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2126
- uses: dart-lang/setup-dart@v1
2227
with:
2328
sdk: ${{ matrix.sdk }}
@@ -32,4 +37,12 @@ jobs:
3237
run: dart analyze --fatal-warnings --fatal-infos
3338

3439
- name: Run tests
35-
run: bash ./coverage.sh && bash <(curl -s https://codecov.io/bash)
40+
run: |
41+
set -e
42+
./coverage.sh
43+
bash <(curl -s https://codecov.io/bash)
44+
shell: bash
45+
env:
46+
QINIU_DART_SDK_ACCESS_KEY: ${{ secrets.QINIU_DART_SDK_ACCESS_KEY }}
47+
QINIU_DART_SDK_SECRET_KEY: ${{ secrets.QINIU_DART_SDK_SECRET_KEY }}
48+
QINIU_DART_SDK_TOKEN_SCOPE: ${{ secrets.QINIU_DART_SDK_TOKEN_SCOPE }}

.github/workflows/flutter.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,29 @@ on: [push, pull_request]
88

99
jobs:
1010
flutter:
11-
runs-on: ubuntu-latest
1211
strategy:
1312
fail-fast: false
1413
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
1515
flutter_version: ['3.16.x', '3.19.x', '3.22.x']
16+
runs-on: ${{ matrix.os }}
1617
defaults:
1718
run:
1819
working-directory: ./flutter
19-
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
- uses: subosito/flutter-action@v2
2323
with:
2424
channel: stable
2525
flutter-version: ${{ matrix.flutter_version }}
2626

2727
- run: flutter pub add 'qiniu_sdk_base:{"path":"../base"}' -C .
28+
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
29+
- run: |
30+
echo 'dependency_overrides:' >> pubspec.yaml
31+
echo ' qiniu_sdk_base:' >> pubspec.yaml
32+
echo ' path: ../base' >> pubspec.yaml
33+
shell: bash
34+
if: ${{ runner.os == 'Windows' }}
2835
- run: flutter pub get
2936
- run: flutter test

.github/workflows/version-check.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Dart / Flutter SDK Version Check
2+
on:
3+
push:
4+
tags:
5+
- "base-[0-9]+.[0-9]+.[0-9]+"
6+
- "flutter-[0-9]+.[0-9]+.[0-9]+"
7+
jobs:
8+
linux:
9+
name: Version Check
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: Set env
15+
run: |
16+
echo "BASE_VERSION=${GITHUB_REF#refs/*/base-}" >> $GITHUB_ENV
17+
echo "FLUTTER_VERSION=${GITHUB_REF#refs/*/flutter-}" >> $GITHUB_ENV
18+
- name: Check
19+
run: |
20+
set -e
21+
grep -qF "## ${BASE_VERSION}" base/CHANGELOG.md
22+
grep -qF "final Version currentVersion = Version.parse('${BASE_VERSION}');" base/lib/src/version.dart
23+
grep -qF "## ${FLUTTER_VERSION}" flutter/CHANGELOG.md
24+
grep -qF "final Version currentVersion = Version.parse('${FLUTTER_VERSION}');" flutter/lib/src/version.dart

base/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.7.0
2+
3+
- 增强区域查询和上传的可靠性
4+
15
## 0.6.3
26

37
- 补充遗漏的 Content-Type

base/coverage.sh

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ dart \
1717
--enable-vm-service=$OBS_PORT \
1818
test/test_coverage.dart &
1919

20+
pid="$!"
21+
2022
# Run the coverage collector to generate the JSON coverage report.
2123
echo "Collecting coverage..."
2224
dart pub run coverage:collect_coverage \
@@ -31,3 +33,5 @@ dart pub run coverage:format_coverage \
3133
--in=coverage/coverage.json \
3234
--out=coverage/lcov.info \
3335
--report-on=lib
36+
37+
wait "$pid"

base/lib/qiniu_sdk_base.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
library qiniu_sdk_base;
2-
31
export 'src/auth/auth.dart';
42
export 'src/error/error.dart';
53
export 'src/storage/storage.dart';
4+
export 'src/version.dart';

base/lib/src/storage/config/config.dart

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
import 'package:dio/dio.dart';
1+
import 'dart:convert';
2+
import 'dart:io';
23

3-
import '../../storage/error/error.dart';
4+
import 'package:dio/dio.dart';
5+
import 'package:crypto/crypto.dart';
6+
import 'package:convert/convert.dart';
7+
import 'package:qiniu_sdk_base/src/storage/storage.dart';
8+
import 'package:cache_provider/cache_provider.dart' as cache_provider;
9+
import 'package:singleflight/singleflight.dart' as singleflight;
10+
import 'package:path/path.dart' show join;
411

512
part 'cache.dart';
613
part 'host.dart';
714
part 'protocol.dart';
15+
part 'region.dart';
16+
part 'query.dart';
817

918
class Config {
1019
final HostProvider hostProvider;
@@ -20,8 +29,10 @@ class Config {
2029
HostProvider? hostProvider,
2130
CacheProvider? cacheProvider,
2231
HttpClientAdapter? httpClientAdapter,
23-
this.retryLimit = 3,
24-
}) : hostProvider = hostProvider ?? DefaultHostProvider(),
32+
this.retryLimit = 10,
33+
}) : hostProvider = hostProvider ?? DefaultHostProviderV2(),
2534
cacheProvider = cacheProvider ?? DefaultCacheProvider(),
2635
httpClientAdapter = httpClientAdapter ?? HttpClientAdapter();
36+
37+
Future<String> get appUserAgent async => '';
2738
}

0 commit comments

Comments
 (0)