Skip to content

Commit

Permalink
Try fix favour
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed May 22, 2022
1 parent 1572a5e commit f0bb703
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 20 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:

env:
flutter_channel: 'stable'
flutter_version: '2.10.3'
GH_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
Expand Down Expand Up @@ -59,23 +58,40 @@ jobs:
config:
- target: linux
host: ubuntu-latest
flutter_version: '3.0.1'
- target: windows
host: windows-latest
flutter_version: '3.0.1'
- target: macos
host: macos-latest
flutter_version: '3.0.1'
- target: ios
host: macos-latest
flutter_version: '3.0.1'
- target: android-arm32
host: ubuntu-latest
flutter_version: '3.0.1'
- target: android-arm64
host: ubuntu-latest
flutter_version: '3.0.1'
- target: android-x86_64
host: ubuntu-latest
flutter_version: '3.0.1'
- target: android-arm32
host: ubuntu-latest
flutter_version: '2.10.5'
- target: android-arm64
host: ubuntu-latest
flutter_version: '2.10.5'
- target: android-x86_64
host: ubuntu-latest
flutter_version: '2.10.5'

runs-on: ${{ matrix.config.host }}

env:
TARGET: ${{ matrix.config.target }}
flutter_version: ${{ matrix.config.flutter_version }}

steps:
- name: Checkout
Expand Down Expand Up @@ -156,6 +172,12 @@ jobs:
cd ci
cp version.code.txt ../lib/assets/version.txt
- name: Sed old deps (Android)
if: steps.check_asset.outputs.skip_build != 'true' && ( matrix.config.flutter_version == '2.10.5')
run: |
sed -i "s/another_xlider: ^1.0.1+2/another_xlider: 1.0.1+2/g" pubspec.yaml
sed -i "s/flutter_styled_toast: ^2.0.0/flutter_styled_toast: 2.0.0/g" pubspec.yaml
- name: Install rust target and build (ios)
if: steps.check_asset.outputs.skip_build != 'true' && ( matrix.config.target == 'ios')
run: |
Expand Down
6 changes: 0 additions & 6 deletions ci/linux_font.yaml

This file was deleted.

25 changes: 20 additions & 5 deletions ci/src/check_asset/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use serde_derive::Deserialize;
use serde_derive::Serialize;
use serde_json::Value;
use anyhow::Result;

const OWNER: &str = "niuhuan";
const REPO: &str = "jasmine";
Expand All @@ -13,14 +13,18 @@ async fn main() -> Result<()> {
if gh_token.is_empty() {
panic!("Please set GH_TOKEN");
}
let flutter_version = std::env::var("flutter_version")?;
if flutter_version.is_empty() {
panic!("Please set flutter_version");
}

let target = std::env::var("TARGET")?;

let vs_code_txt = tokio::fs::read_to_string("version.code.txt").await?;

let code = vs_code_txt.trim();

let release_file_name = match target.as_str() {
let mut release_file_name = match target.as_str() {
"macos" => format!("jasmine-{}-macos-intel.dmg", code),
"ios" => format!("jasmine-{}-ios-nosign.ipa", code),
"windows" => format!("jasmine-{}-windows-x86_64.zip", code),
Expand All @@ -30,12 +34,20 @@ async fn main() -> Result<()> {
"android-x86_64" => format!("jasmine-{}-android-x86_64.apk", code),
un => panic!("unknown target : {}", un),
};
if flutter_version == "2.10.5" {
release_file_name = release_file_name + "old_flutter-"
}

let client = reqwest::ClientBuilder::new().user_agent(UA).build()?;

let check_response = client.get(format!("https://api.github.com/repos/{}/{}/releases/tags/{}", OWNER, REPO, code))
let check_response = client
.get(format!(
"https://api.github.com/repos/{}/{}/releases/tags/{}",
OWNER, REPO, code
))
.header("Authorization", format!("token {}", gh_token))
.send().await?;
.send()
.await?;

match check_response.status().as_u16() {
200 => (),
Expand All @@ -48,7 +60,10 @@ async fn main() -> Result<()> {
let release: Release = check_response.json().await?;

let ass_names: Vec<String> = release.assets.iter().map(|a| a.name.clone()).collect();
println!("::set-output name=skip_build::{}", ass_names.contains(&release_file_name));
println!(
"::set-output name=skip_build::{}",
ass_names.contains(&release_file_name)
);
Ok(())
}

Expand Down
6 changes: 5 additions & 1 deletion ci/src/upload_asset/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ async fn main() -> Result<()> {
// get ghToken
let gh_token = std::env::var("GH_TOKEN")?;
let target = std::env::var("TARGET")?;
let flutter_version = std::env::var("flutter_version")?;

let vs_code_txt = tokio::fs::read_to_string("version.code.txt").await?;

let code = vs_code_txt.trim();

let release_file_name = match target.as_str() {
let mut release_file_name = match target.as_str() {
"macos" => format!("jasmine-{}-macos-intel.dmg", code),
"ios" => format!("jasmine-{}-ios-nosign.ipa", code),
"windows" => format!("jasmine-{}-windows-x86_64.zip", code),
Expand All @@ -27,6 +28,9 @@ async fn main() -> Result<()> {
"android-x86_64" => format!("jasmine-{}-android-x86_64.apk", code),
un => panic!("unknown target : {}", un),
};
if flutter_version == "2.10.5" {
release_file_name = release_file_name + "old_flutter-"
}

let local_path = match target.as_str() {
"macos" => "../build/macos.dmg",
Expand Down
2 changes: 1 addition & 1 deletion ci/version.code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.2.5
v1.2.6
4 changes: 1 addition & 3 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
- [x] 夜间模式
- [x] 讨论区
- [x] 修复单章节漫画不能从图片处继续阅读的BUG
- [x] 尝试修复收藏
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.11.2
COCOAPODS: 1.11.3
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ dependencies:
cupertino_icons: ^1.0.2
flutter_svg: ^1.0.0
permission_handler: ^8.3.0
flutter_styled_toast: ^2.1.3
flutter_styled_toast: ^2.0.0
photo_view: ^0.13.0
event: ^2.0.5
modal_bottom_sheet: ^2.0.0
another_xlider: ^1.0.0
another_xlider: ^1.0.1+2
scrollable_positioned_list: ^0.2.3
url_launcher: ^6.0.17
clipboard: ^0.1.3
Expand Down

0 comments on commit f0bb703

Please sign in to comment.