chore: update go version [beta] [appcenter] [notarize]

This commit is contained in:
yicheng 2020-12-28 16:25:10 +08:00
parent 67210b1acb
commit 5532a57cdb
5 changed files with 71 additions and 30 deletions

View File

@ -2,6 +2,9 @@ name: ClashX
on: [push]
env:
FASTLANE_SKIP_UPDATE_CHECK: true
jobs:
build:
runs-on: macOS-latest
@ -14,11 +17,33 @@ jobs:
gem install bundler:1.16.2
bundle install
- name: setup Go
- name: setup Go 1.16
uses: actions/setup-go@v2
with:
stable: 'false'
go-version: 1.16.0-beta1
- name: build core arm
run: |
echo `go version`
cd ClashX/goClash
python3 build_clash_arm64.py
cd ../..
- name: setup Go stable
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: build core x86
run: |
echo `go version`
cd ClashX/goClash
python3 build_clash.py
mv goClash.a goClash_x86.a
lipo *.a -create -output goClash.a
cd ../..
- name: update beta build version
if: contains(github.event.head_commit.message, '[beta]') && !startsWith(github.ref, 'refs/tags/')
run: |
@ -29,7 +54,7 @@ jobs:
env:
CODE_SIGN_IDENTITY: "Developer ID Application: Fuzhou West2Online Internet Inc. (MEWHFZ92DY)"
run: |
bash install_dependency.sh
bash install_dependency.sh skip-build-go
cd ClashX
python3 add_build_info.py
cd ..

View File

@ -904,7 +904,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 5217C006C5A22A1CEA24BFC1 /* Pods-ClashX.debug.xcconfig */;
buildSettings = {
ARCHS = x86_64;
ARCHS = "$(ARCHS_STANDARD)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ClashX/ClashX.entitlements;
CODE_SIGN_IDENTITY = "-";
@ -947,7 +947,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = A1485BCE642059532D01B8BA /* Pods-ClashX.release.xcconfig */;
buildSettings = {
ARCHS = x86_64;
ARCHS = "$(ARCHS_STANDARD)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ClashX/ClashX.entitlements;
CODE_SIGN_IDENTITY = "Developer ID Application";
@ -991,7 +991,7 @@
F9A7C06E2306E874007163C7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = x86_64;
ARCHS = "$(ARCHS_STANDARD)";
CODE_SIGN_ENTITLEMENTS = ProxyConfigHelper/com.west2online.ClashX.ProxyConfigHelper.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
@ -1022,7 +1022,7 @@
F9A7C06F2306E874007163C7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = x86_64;
ARCHS = "$(ARCHS_STANDARD)";
CODE_SIGN_ENTITLEMENTS = ProxyConfigHelper/com.west2online.ClashX.ProxyConfigHelper.entitlements;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;

View File

@ -0,0 +1,40 @@
import subprocess
import datetime
import os
def get_version():
with open('./go.mod') as file:
for line in file.readlines():
if "clash-premium" in line:
return line.split("-")[-1].strip()[:6]
return "unknown"
def build_clash(version,build_time,arch):
clang = f"{os.getcwd()}/clangWrap.sh"
command = f"""
go build -trimpath -ldflags '-X "github.com/Dreamacro/clash/constant.Version={version}" \
-X "github.com/Dreamacro/clash/constant.BuildTime={build_time}"' \
-buildmode=c-archive -o goClash_{arch}.a """
envs = os.environ.copy()
envs.update({
"CC":clang,
"CXX":clang,
"GOOS":"darwin",
"GOARCH":arch,
"CGO_ENABLED":"1",
"CGO_LDFLAGS":"-mmacosx-version-min=10.12",
"CGO_CFLAGS":"-mmacosx-version-min=10.12",
})
subprocess.check_output(command, shell=True,env=envs)
def run():
version = get_version()
build_time = datetime.datetime.now().strftime("%Y-%m-%d-%H%M")
print("current clash version:", version)
build_clash(version,build_time,"arm64")
if __name__ == "__main__":
run()

View File

@ -57,18 +57,4 @@ lane :addKeyChain do
certificate_password:""
)
end
end
lane :setARM do
update_xcodeproj(
xcodeproj: 'ClashX.xcodeproj',
options: {'ARCHS': 'arm64'}
)
end
lane :setUniversal do
update_xcodeproj(
xcodeproj: 'ClashX.xcodeproj',
options: {'ARCHS': '$(ARCHS_STANDARD)'}
)
end

View File

@ -30,16 +30,6 @@ fastlane beta
fastlane addKeyChain
```
### setARM
```
fastlane setARM
```
### setUniversal
```
fastlane setUniversal
```
----