Skip to content

Commit

Permalink
fastlane
Browse files Browse the repository at this point in the history
  • Loading branch information
yanue committed Aug 1, 2023
1 parent 61beac5 commit 7341de2
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function generateAppcast() {
if [[ -z "$description" ]]; then
description="bug fix"
fi
downloadUrl="https://github.com/yanue/V2rayU/releases/download/${APP_Version}/V2rayU.dmg"
downloadUrl="https://github.com/yanue/V2rayU/releases/download/${APP_Version}/V2rayU-64.dmg"
# https://github.com/c9s/appcast.git
${AppCastDir}/appcast -append\
-dsaSignature="PW8pDnr5VZkmC93gZjUDlHI8gkJSspPoDU3DdhsMkps"\
Expand Down
24 changes: 24 additions & 0 deletions Build/sign.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

# sign.sh
# V2rayU
#
# Created by yanue on 2023/8/1.
# Copyright © 2023 yanue. All rights reserved.

APP=$1
RELEASE_ID=$2
FILE=$3

SIGNATURE=$(./bin/sign_update ${FILE} | sed 's/[^"]*="\([^"]*\).*/\1/g')
TOKEN=$(security find-generic-password -gws "AppCenter Sparkle Token")
echo "Sign ${APP} release ${RELEASE_ID}, signature $SIGNATURE"

curl -X "PATCH" "https://api.appcenter.ms/v0.1/apps/${APP}/releases/${RELEASE_ID}" \
-H "X-API-Token: $TOKEN" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $"{
\"metadata\": {
\"ed_signature\": \"$SIGNATURE\"
}
}"
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ target 'V2rayU' do

# Pods for V2rayU
pod 'AppCenter'
pod 'fastlane'
pod 'Alamofire'
pod 'SwiftyJSON'
# master branch
Expand Down
38 changes: 32 additions & 6 deletions V2rayU.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
66ACB1A021757D5B005B5881 /* MainMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66ACB19F21757D5B005B5881 /* MainMenu.swift */; };
66AD5335241497000070529C /* Shortcut.m in Sources */ = {isa = PBXBuildFile; fileRef = 66AD5330241496FF0070529C /* Shortcut.m */; };
66BC2B89228C589E00FBB716 /* V2raySubscribe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66BC2B88228C589E00FBB716 /* V2raySubscribe.swift */; };
66C3F2762A795D2D004F1234 /* Pluginfile in Resources */ = {isa = PBXBuildFile; fileRef = 66C3F2752A795D2C004F1234 /* Pluginfile */; };
66C3F2792A795DD5004F1234 /* Appfile in Resources */ = {isa = PBXBuildFile; fileRef = 66C3F2772A795DD5004F1234 /* Appfile */; };
66C3F27A2A795DD5004F1234 /* Fastfile in Resources */ = {isa = PBXBuildFile; fileRef = 66C3F2782A795DD5004F1234 /* Fastfile */; };
66C3F27C2A795F44004F1234 /* Readme.md in Resources */ = {isa = PBXBuildFile; fileRef = 66C3F27B2A795F44004F1234 /* Readme.md */; };
66F07CF9236D79540088A4AE /* ping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66F07CF8236D79540088A4AE /* ping.swift */; };
66F411B121CA49EE007AAC10 /* pac in Copy Files */ = {isa = PBXBuildFile; fileRef = 6683B1EA21C2AD1A004A1C5F /* pac */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
66F411B521CA8921007AAC10 /* cmd.sh in Resources */ = {isa = PBXBuildFile; fileRef = 66F411B421CA8921007AAC10 /* cmd.sh */; };
Expand Down Expand Up @@ -163,6 +167,11 @@
66AD5330241496FF0070529C /* Shortcut.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Shortcut.m; sourceTree = "<group>"; };
66AD5333241496FF0070529C /* V2rayU-Bridging-header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "V2rayU-Bridging-header.h"; sourceTree = "<group>"; };
66BC2B88228C589E00FBB716 /* V2raySubscribe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = V2raySubscribe.swift; sourceTree = "<group>"; };
66C3F2732A795A86004F1234 /* sign.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = sign.sh; sourceTree = "<group>"; };
66C3F2752A795D2C004F1234 /* Pluginfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Pluginfile; sourceTree = "<group>"; };
66C3F2772A795DD5004F1234 /* Appfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Appfile; sourceTree = "<group>"; };
66C3F2782A795DD5004F1234 /* Fastfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Fastfile; sourceTree = "<group>"; };
66C3F27B2A795F44004F1234 /* Readme.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Readme.md; sourceTree = "<group>"; };
66C5B194240B58B8008A22CA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = ../en.lproj/PreferenceAdvance.strings; sourceTree = "<group>"; };
66F07CF8236D79540088A4AE /* ping.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ping.swift; sourceTree = "<group>"; };
66F3029C22AAA0A600FCA4E2 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/MainMenu.strings"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -276,6 +285,7 @@
664EB368216C9A5E00B6AE0D = {
isa = PBXGroup;
children = (
66C3F2742A795D2C004F1234 /* fastlane */,
66A77BE2268225790097A126 /* v2ray-core */,
66AD532D241496EF0070529C /* Common */,
6683B1EA21C2AD1A004A1C5F /* pac */,
Expand Down Expand Up @@ -344,6 +354,17 @@
name = Common;
sourceTree = "<group>";
};
66C3F2742A795D2C004F1234 /* fastlane */ = {
isa = PBXGroup;
children = (
66C3F2772A795DD5004F1234 /* Appfile */,
66C3F2782A795DD5004F1234 /* Fastfile */,
66C3F2752A795D2C004F1234 /* Pluginfile */,
66C3F27B2A795F44004F1234 /* Readme.md */,
);
path = fastlane;
sourceTree = "<group>";
};
66FEAD44217D75D7009DECF9 /* Build */ = {
isa = PBXGroup;
children = (
Expand All @@ -353,6 +374,7 @@
6653C20422E0A2B700754D66 /* publish.sh */,
6D6DF927AC79EEF7378C192A /* appdmg.json */,
66757C6C2A5C505300758F32 /* appdmg.sh */,
66C3F2732A795A86004F1234 /* sign.sh */,
);
path = Build;
sourceTree = "<group>";
Expand Down Expand Up @@ -528,14 +550,18 @@
66A77BE3268225790097A126 /* v2ray-core in Resources */,
667029D321AFB86E0079EF41 /* QrcodeWindow.xib in Resources */,
6662C20B240EA782000AF6CD /* PreferenceDns.xib in Resources */,
66C3F2762A795D2D004F1234 /* Pluginfile in Resources */,
6650AAAD21771E11000909D8 /* unzip.sh in Resources */,
6610ECB721742AFD008FC401 /* MainMenu.xib in Resources */,
66107B8622DEDBE4002FFB60 /* Localizable.strings in Resources */,
66F411B521CA8921007AAC10 /* cmd.sh in Resources */,
66C3F2792A795DD5004F1234 /* Appfile in Resources */,
664EB377216C9A5F00B6AE0D /* Assets.xcassets in Resources */,
66C3F27A2A795DD5004F1234 /* Fastfile in Resources */,
66FEAD53217EE14C009DECF9 /* ConfigWindow.xib in Resources */,
6618372E23E9BF74000F7410 /* ToastWindow.xib in Resources */,
6D6DFEA4ED44E1BE02451B6D /* PreferenceAbout.strings in Resources */,
66C3F27C2A795F44004F1234 /* Readme.md in Resources */,
6D6DF95B4749491F1D600B05 /* PreferenceAdvance.strings in Resources */,
6D6DFC1618D163A9DFE3B628 /* PreferenceGeneral.strings in Resources */,
6D6DFFD18860EBE148F6DF1F /* PreferencePac.strings in Resources */,
Expand Down Expand Up @@ -772,7 +798,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = V2rayULauncher/V2rayULauncher.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
Expand Down Expand Up @@ -802,7 +828,7 @@
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = RJYEH6TCJD;
INFOPLIST_FILE = V2rayULauncher/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = V2rayULauncher;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -947,7 +973,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
Expand Down Expand Up @@ -993,7 +1019,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = RJYEH6TCJD;
ENABLE_ONLY_ACTIVE_RESOURCES = YES;
INFOPLIST_FILE = V2rayU/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = V2rayU;
Expand Down Expand Up @@ -1021,7 +1047,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = UA5X5UL787;
Expand All @@ -1041,7 +1067,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = RJYEH6TCJD;
INFOPLIST_FILE = "";
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayUTool;
Expand Down
2 changes: 2 additions & 0 deletions fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address
52 changes: 52 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
lane :build do

addKeyChain

build_app(
workspace: "V2rayU.xcworkspace",
scheme: "V2rayU",
export_method: "developer-id",
skip_package_pkg: "false",
clean: "true",
derived_data_path: "./build_derived_data"
)
end

lane :check do
build_app(
workspace: "V2rayU.xcworkspace",
scheme: "V2rayU",
codesigning_identity: "-",
export_method: "developer-id",
skip_package_pkg: "true",
clean: "true",
derived_data_path: "./build_derived_data"
)
end

lane :addKeyChain do
if is_ci?

puts("create custom keychain")

delete_keychain(
name: "v2rayUBuild"
) if File.exist? File.expand_path("~/Library/Keychains/v2rayUBuild-db")

create_keychain(
name: "v2rayUBuild",
default_keychain: false,
unlock: true,
timeout: 3600,
lock_when_sleeps: false,
password: "password"
)

import_certificate(
certificate_path: "Build/sign.p12",
keychain_name:"v2rayUBuild",
keychain_password:"v2rayUBuild",
certificate_password:""
)
end
end
5 changes: 5 additions & 0 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-appcenter'
46 changes: 46 additions & 0 deletions fastlane/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
fastlane documentation
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```sh
xcode-select --install
```

For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

### build

```sh
[bundle exec] fastlane build
```



### check

```sh
[bundle exec] fastlane check
```



### addKeyChain

```sh
[bundle exec] fastlane addKeyChain
```



----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
25 changes: 25 additions & 0 deletions fastlane/report.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="fastlane.lanes">




<testcase classname="fastlane.lanes" name="0: Switch to addKeyChain lane" time="0.001135">

</testcase>


<testcase classname="fastlane.lanes" name="1: is_ci" time="0.000748">

</testcase>


<testcase classname="fastlane.lanes" name="2: build_app" time="426.002096">

<failure message="/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/actions/actions_helper.rb:67:in `execute_action'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'&#10;Fastfile:5:in `block in parsing_binding'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/lane.rb:33:in `call'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:45:in `execute'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/commands_generator.rb:354:in `run'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'&#10;/Users/yanue/.gem/ruby/2.6.0/gems/fastlane-2.214.0/bin/fastlane:23:in `&lt;top (required)&gt;'&#10;/Users/yanue/.gem/ruby/2.6.0/bin/fastlane:25:in `load'&#10;/Users/yanue/.gem/ruby/2.6.0/bin/fastlane:25:in `&lt;main&gt;'&#10;&#10;Error packaging up the application" />

</testcase>

</testsuite>
</testsuites>

0 comments on commit 7341de2

Please sign in to comment.