Fix build scripts

This commit is contained in:
Tindy X committed 2023-12-11 03:55:36 +08:00
1 parent 2cb7fc7e19
commit 8485c2c778
4 files changed
+46 -13

No files matched your search

+16 -8
View File
@@ -39,7 +39,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/amd64 platforms: linux/amd64
context: scripts/ context: .
file: scripts/Dockerfile
tags: tindy2013/subconverter:latest tags: tindy2013/subconverter:latest
build-args: | build-args: |
SHA=${{ steps.vars.outputs.sha_short }} SHA=${{ steps.vars.outputs.sha_short }}
@@ -60,7 +61,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/amd64 platforms: linux/amd64
context: scripts/ context: .
file: scripts/Dockerfile
tags: tindy2013/subconverter:${{steps.version.outputs.result}} tags: tindy2013/subconverter:${{steps.version.outputs.result}}
outputs: type=image,push=true outputs: type=image,push=true
@@ -106,7 +108,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/386 platforms: linux/386
context: scripts/ context: .
file: scripts/Dockerfile
tags: tindy2013/subconverter:latest tags: tindy2013/subconverter:latest
build-args: | build-args: |
SHA=${{ steps.vars.outputs.sha_short }} SHA=${{ steps.vars.outputs.sha_short }}
@@ -127,7 +130,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/386 platforms: linux/386
context: scripts/ context: .
file: scripts/Dockerfile
tags: tindy2013/subconverter:${{steps.version.outputs.result}} tags: tindy2013/subconverter:${{steps.version.outputs.result}}
outputs: type=image,push=true outputs: type=image,push=true
@@ -173,7 +177,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/arm/v7 platforms: linux/arm/v7
context: scripts/ context: .
file: scripts/Dockerfile
tags: tindy2013/subconverter:latest tags: tindy2013/subconverter:latest
build-args: | build-args: |
SHA=${{ steps.vars.outputs.sha_short }} SHA=${{ steps.vars.outputs.sha_short }}
@@ -195,7 +200,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/arm/v7 platforms: linux/arm/v7
context: scripts/ context: .
file: scripts/Dockerfile
tags: tindy2013/subconverter:${{steps.version.outputs.result}} tags: tindy2013/subconverter:${{steps.version.outputs.result}}
build-args: | build-args: |
THREADS=4 THREADS=4
@@ -243,7 +249,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/arm64 platforms: linux/arm64
context: scripts/ context: .
file: scripts/Dockerfile
tags: tindy2013/subconverter:latest tags: tindy2013/subconverter:latest
build-args: | build-args: |
SHA=${{ steps.vars.outputs.sha_short }} SHA=${{ steps.vars.outputs.sha_short }}
@@ -265,7 +272,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/arm64 platforms: linux/arm64
context: scripts/ context: .
file: scripts/Dockerfile
tags: tindy2013/subconverter:${{steps.version.outputs.result}} tags: tindy2013/subconverter:${{steps.version.outputs.result}}
build-args: | build-args: |
THREADS=4 THREADS=4
+3 -2
View File
@@ -42,9 +42,10 @@ RUN set -xe && \
# [ -n "$SHA" ] && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h;\ # [ -n "$SHA" ] && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h;\
# cmake -DCMAKE_BUILD_TYPE=Release -DUSE_EXTERNAL_CURL=ON -DUSE_EXTERNAL_RAPIDJSON=ON -DUSE_EXTERNAL_YAML_CPP=ON . && \ # cmake -DCMAKE_BUILD_TYPE=Release -DUSE_EXTERNAL_CURL=ON -DUSE_EXTERNAL_RAPIDJSON=ON -DUSE_EXTERNAL_YAML_CPP=ON . && \
# make -j $THREADS && \ # make -j $THREADS && \
ls -alh && \
source "$HOME/.xmake/profile" && \ source "$HOME/.xmake/profile" && \
xmake f --root --static=false -m release && \ xmake f --root --static=false -m release -y -v && \
xmake --root subconverter --build release && \ xmake --root -v subconverter && \
python3 -m ensurepip && \ python3 -m ensurepip && \
python3 -m pip install gitpython && \ python3 -m pip install gitpython && \
python3 scripts/update_rules.py -c scripts/rules_config.conf python3 scripts/update_rules.py -c scripts/rules_config.conf
+7 -3
View File
@@ -8,14 +8,18 @@ option("static")
option_end() option_end()
add_requires("pcre2", "yaml-cpp", "rapidjson", "toml11") add_requires("pcre2", "yaml-cpp", "rapidjson", "toml11")
add_requires("libcurl >=8.4.0")
add_requires("xmake::libcurl >=8.4.0", {configs = {shared = not has_config("static"), mbedtls = is_plat("linux"), openssl = false}})
includes("xmake/libcron.lua") includes("xmake/libcron.lua")
includes("xmake/yaml-cpp-static.lua") includes("xmake/yaml-cpp-static.lua")
includes("xmake/quickjspp.lua") includes("xmake/quickjspp.lua")
includes("xmake/curl-static.lua")
add_requires("libcron", {system = false}) add_requires("libcron", {system = false})
add_requires("yaml-cpp-static", {system = false}) add_requires("yaml-cpp-static", {system = false})
add_requires("quickjspp", {system = false}) add_requires("quickjspp", {system = false})
if not is_plat("macosx") and has_config("static") then
add_requires("curl-static", {system = false})
else
add_requires("libcurl")
end
target("subconverter") target("subconverter")
set_kind("binary") set_kind("binary")
@@ -32,7 +36,7 @@ target("subconverter")
if is_plat("macosx") then if is_plat("macosx") then
add_packages("libcurl") add_packages("libcurl")
else else
add_packages("xmake::libcurl") add_packages("curl-static")
end end
if has_config("static") then if has_config("static") then
add_packages("yaml-cpp-static") add_packages("yaml-cpp-static")
+20
View File
@@ -0,0 +1,20 @@
package("curl-static")
add_deps("cmake")
add_versions("8.5.0", "7161cb17c01dcff1dc5bf89a18437d9d729f1ecd")
set_urls("https://github.com/curl/curl.git")
on_install(function (package)
local configs = {}
table.insert(configs, "-DCURL_USE_LIBSSH2=OFF")
table.insert(configs, "-DHAVE_LIBIDN2=OFF")
table.insert(configs, "-DCURL_USE_LIBPSL=OFF")
table.insert(configs, "-DBUILD_CURL_EXE=OFF")
table.insert(configs, "-DBUILD_TESTING=OFF")
table.insert(configs, "-DCURL_USE_MBEDTLS=" .. (package:is_plat("linux") and "ON" or "OFF"))
table.insert(configs, "-DCURL_USE_SCHANNEL=" .. (package:is_plat("windows") and "ON" or "OFF"))
table.insert(configs, "-DHTTP_ONLY=ON")
table.insert(configs, "-DCURL_USE_LIBSSH2=OFF")
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
package_end()