[earthly] add windows build generation

This commit is contained in:
Vladimir Stoilov 2024-05-10 17:02:42 +03:00
parent 742da7e9b5
commit 2da6bcc28d
No known key found for this signature in database
GPG key ID: 2F190B67A43A81AF
5 changed files with 149 additions and 89 deletions

View file

@ -368,7 +368,7 @@ tauri-build:
END
# Just for debugging ...
RUN ls -R ./binaries
# RUN ls -R ./binaries
# The following is exected to work but doesn't. for whatever reason cargo-sweep errors out on the windows-toolchain.
#
@ -411,6 +411,55 @@ tauri-build:
SAVE ARTIFACT --if-exists "target/${target}/release/bundle/deb/*.deb" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/"
SAVE ARTIFACT --if-exists "target/${target}/release/bundle/rpm/*.rpm" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/"
tauri-prep-windows:
FROM +angular-base --configuration=production
ARG target="x86_64-pc-windows-msvc"
# if we want tauri to create the installer bundles we also need to provide all external binaries
# we need to do some magic here because tauri expects the binaries to include the rust target tripple.
# We already know that triple because it's a required argument. From that triple, we use +RUST_TO_GO_ARCH_STRING
# function from below to parse the triple and guess wich GOOS and GOARCH we need.
RUN mkdir /tmp/gobuild
RUN mkdir ./binaries
DO +RUST_TO_GO_ARCH_STRING --rustTarget="${target}"
RUN echo "GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} GO_ARCH_STRING=${GO_ARCH_STRING}"
# Our tauri app has externalBins configured so tauri will try to embed them when it finished compiling
# the app. Make sure we copy portmaster-start and portmaster-core in all architectures supported.
# See documentation for externalBins for more information on how tauri searches for the binaries.
COPY (+go-build/output --GOOS="${GOOS}" --CMDS="portmaster-start portmaster-core" --GOARCH="${GOARCH}" --GOARM="${GOARM}") /tmp/gobuild
# Place them in the correct folder with the rust target tripple attached.
FOR bin IN $(ls /tmp/gobuild)
# ${bin$.*} does not work in SET commands unfortunately so we use a shell
# snippet here:
RUN set -e ; \
dest="./binaries/${bin}-${target}" ; \
if [ -z "${bin##*.exe}" ]; then \
dest="./binaries/${bin%.*}-${target}.exe" ; \
fi ; \
cp "/tmp/gobuild/${bin}" "${dest}" ;
END
# Copy source
COPY --keep-ts ./desktop/tauri/src-tauri src-tauri
COPY --keep-ts ./assets assets
# Build UI
ENV NODE_ENV="production"
RUN --no-cache ./node_modules/.bin/ng build --configuration production --base-href / "tauri-builtin"
# Just for debugging ...
# RUN ls -R ./binaries
# RUN ls -R ./dist
SAVE ARTIFACT "./dist/tauri-builtin" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/angular/dist/"
SAVE ARTIFACT "./src-tauri" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/tauri/src-tauri"
SAVE ARTIFACT "./binaries" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/tauri/src-tauri/"
SAVE ARTIFACT "./assets" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/tauri/assets"
tauri-release:
FROM ${work_image}

View file

@ -569,9 +569,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "base64"
version = "0.22.0"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "base64ct"
@ -986,9 +986,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.0.95"
version = "1.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b"
checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd"
dependencies = [
"jobserver",
"libc",
@ -1615,17 +1615,6 @@ dependencies = [
"serde",
]
[[package]]
name = "derivative"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "derive_builder"
version = "0.12.0"
@ -2893,9 +2882,6 @@ name = "heck"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "heck"
@ -4659,7 +4645,7 @@ version = "3.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae"
dependencies = [
"base64 0.22.0",
"base64 0.22.1",
"serde",
]
@ -4680,9 +4666,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "pest"
version = "2.7.9"
version = "2.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95"
checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8"
dependencies = [
"memchr",
"thiserror",
@ -4691,9 +4677,9 @@ dependencies = [
[[package]]
name = "pest_derive"
version = "2.7.9"
version = "2.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c"
checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459"
dependencies = [
"pest",
"pest_generator",
@ -4701,9 +4687,9 @@ dependencies = [
[[package]]
name = "pest_generator"
version = "2.7.9"
version = "2.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd"
checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687"
dependencies = [
"pest",
"pest_meta",
@ -4714,9 +4700,9 @@ dependencies = [
[[package]]
name = "pest_meta"
version = "2.7.9"
version = "2.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca"
checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd"
dependencies = [
"once_cell",
"pest",
@ -5425,7 +5411,7 @@ version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10"
dependencies = [
"base64 0.22.0",
"base64 0.22.1",
"bytes",
"futures-core",
"futures-util",
@ -5864,9 +5850,9 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.199"
version = "1.0.200"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a"
checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f"
dependencies = [
"serde_derive",
]
@ -5883,9 +5869,9 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.199"
version = "1.0.200"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc"
checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb"
dependencies = [
"proc-macro2",
"quote",
@ -5972,7 +5958,7 @@ version = "3.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20"
dependencies = [
"base64 0.22.0",
"base64 0.22.1",
"chrono",
"hex",
"indexmap 1.9.3",
@ -6649,9 +6635,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
[[package]]
name = "tauri"
version = "2.0.0-beta.16"
version = "2.0.0-beta.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d411ebb670bbe5cf948f6c24978632937329748b499de1619ab55ad31512652"
checksum = "5fedd5490eddf117253945f0baedafded43474c971cba546a818f527d5c26266"
dependencies = [
"anyhow",
"bytes",
@ -6663,7 +6649,7 @@ dependencies = [
"getrandom 0.2.14",
"glob",
"gtk",
"heck 0.4.1",
"heck 0.5.0",
"http 1.1.0",
"image 0.24.9",
"jni",
@ -6721,9 +6707,9 @@ dependencies = [
[[package]]
name = "tauri-bundler"
version = "2.0.1-beta.10"
version = "2.0.1-beta.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ca8bc7e72bbe56d4c7349b3f9176ada49198979d41f36c6098c53be69c1a1de"
checksum = "358b82caaa156444e7e5a8ff75b17cd6f0e61b36cf39d809d7afca2400cc2d21"
dependencies = [
"anyhow",
"ar",
@ -6764,15 +6750,14 @@ dependencies = [
[[package]]
name = "tauri-cli"
version = "2.0.0-beta.14"
version = "2.0.0-beta.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7767938f2f20d17a6ceccda488055b50437694817a406a253508e10622b47e5a"
checksum = "dc93e07aaad2962ed93c0652987ed082787f004cf7cb0d64ff26ee981daefd19"
dependencies = [
"anyhow",
"axum",
"base64 0.22.0",
"base64 0.22.1",
"cargo-mobile2",
"cc",
"clap 4.5.4",
"clap_complete",
"colored",
@ -6785,7 +6770,7 @@ dependencies = [
"env_logger 0.11.3",
"glob",
"handlebars 5.1.2",
"heck 0.4.1",
"heck 0.5.0",
"html5ever",
"ignore",
"image 0.24.9",
@ -6826,7 +6811,7 @@ dependencies = [
"unicode-width",
"ureq",
"url",
"winapi",
"windows-sys 0.52.0",
"zeroize",
]
@ -6836,7 +6821,7 @@ version = "2.0.0-beta.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b383f341efb803852b0235a2f330ca90c4c113f422dd6d646b888685b372cace"
dependencies = [
"base64 0.22.0",
"base64 0.22.1",
"brotli",
"ico",
"json-patch",
@ -6900,9 +6885,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-cli"
version = "2.0.0-beta.3"
version = "2.0.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b079f01e923f7d3bf175e8d31b18861e6580f4b57ce0fdc16fbf69f9acd158c"
checksum = "379e72dd4771d4d4f42c2ea8682f1ad4657fa5a042c3739a5e35300acc694c0c"
dependencies = [
"clap 4.5.4",
"log",
@ -6930,9 +6915,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.0.0-beta.6"
version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87caf6f2b704b0d27b4c64ef1fdd1f6ef97e2f5293216e230ad1efe61de54131"
checksum = "4563f62939a475273e7b75eb4a862f0108969a54db813ef250092d470eff84dc"
dependencies = [
"dunce",
"log",
@ -6948,9 +6933,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-fs"
version = "2.0.0-beta.6"
version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "609f53d90f08808679ecdd81455d9a4d0053291b92780695569f7400fdba27d5"
checksum = "35377195c6923beda5f29482a16b492d431de964389fca9aaf81a0f7e908023f"
dependencies = [
"anyhow",
"glob",
@ -6967,9 +6952,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-notification"
version = "2.0.0-beta.4"
version = "2.0.0-beta.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5a8be5029a046b6b95aac438b9b78e61dbc5194a00efdc35c754de382ddb177"
checksum = "ea96397d3d41aab2c837a8293c617c8097fd89fcbce3df1204fd520d64624e74"
dependencies = [
"log",
"mac-notification-sys",
@ -6988,9 +6973,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-os"
version = "2.0.0-beta.3"
version = "2.0.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c02dc0a2037ef113d9d9db85edceab6f95f83ae111e4d989d6bc1df79c8ab4cf"
checksum = "653c0dbf5f954c7614a5e93f5b548bbe4417b3e1aa553b31ed0b6a2656949459"
dependencies = [
"gethostname",
"log",
@ -7006,9 +6991,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-shell"
version = "2.0.0-beta.3"
version = "2.0.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5624537650f627707f3bd9c6562efe2116c7fb043fcfc2e3d10f802d7870a1cd"
checksum = "d961fa0fcacd8ef43f19af2ee71ae27ee16678417f8cdc9841033eede6f3fdb0"
dependencies = [
"encoding_rs",
"log",
@ -7026,9 +7011,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-single-instance"
version = "2.0.0-beta.6"
version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "637d397ba569fc4fb3dc6f21925138e9ab2d8d388acf2ea6bb919e9d7a99dad9"
checksum = "7f3098fb51fa173551b1ebe417cfb4b7710943011bc4de37c2d1c6c6ea1dca98"
dependencies = [
"log",
"serde",
@ -7041,9 +7026,9 @@ dependencies = [
[[package]]
name = "tauri-runtime"
version = "2.0.0-beta.13"
version = "2.0.0-beta.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7439729d0107c9797764919c39c4a4cc3af64306faaa48271da50d8eb4c0283"
checksum = "148b6e6aff8e63fe5d4ae1d50159d50cfc0b4309abdeca64833c887c6b5631ef"
dependencies = [
"dpi",
"gtk",
@ -7060,9 +7045,9 @@ dependencies = [
[[package]]
name = "tauri-runtime-wry"
version = "2.0.0-beta.13"
version = "2.0.0-beta.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c38dcfa7f8c2b2e344c7401972e0ddaaec4fa655666788d94b1852d6c4a7fe8"
checksum = "398d065c6e0fbf3c4304583759b6e153bc1e0daeb033bede6834ebe4df371fc3"
dependencies = [
"cocoa",
"gtk",
@ -7869,7 +7854,7 @@ version = "2.9.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd"
dependencies = [
"base64 0.22.0",
"base64 0.22.1",
"flate2",
"log",
"once_cell",
@ -7963,9 +7948,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "value-bag"
version = "1.8.1"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8"
checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101"
dependencies = [
"value-bag-serde1",
"value-bag-sval2",
@ -7973,9 +7958,9 @@ dependencies = [
[[package]]
name = "value-bag-serde1"
version = "1.8.1"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc35703541cbccb5278ef7b589d79439fc808ff0b5867195a3230f9a47421d39"
checksum = "ccacf50c5cb077a9abb723c5bcb5e0754c1a433f1e1de89edc328e2760b6328b"
dependencies = [
"erased-serde",
"serde",
@ -7984,9 +7969,9 @@ dependencies = [
[[package]]
name = "value-bag-sval2"
version = "1.8.1"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "285b43c29d0b4c0e65aad24561baee67a1b69dc9be9375d4a85138cbf556f7f8"
checksum = "1785bae486022dfb9703915d42287dcb284c1ee37bd1080eeba78cc04721285b"
dependencies = [
"sval",
"sval_buffer",
@ -8689,7 +8674,7 @@ version = "0.39.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e180ac2740d6cb4d5cec0abf63eacbea90f1b7e5e3803043b13c1c84c4b7884"
dependencies = [
"base64 0.22.0",
"base64 0.22.1",
"block",
"cocoa",
"core-graphics",
@ -8748,9 +8733,9 @@ dependencies = [
[[package]]
name = "x11rb"
version = "0.13.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a"
checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12"
dependencies = [
"gethostname",
"rustix 0.38.34",
@ -8759,9 +8744,9 @@ dependencies = [
[[package]]
name = "x11rb-protocol"
version = "0.13.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34"
checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d"
[[package]]
name = "x25519-dalek"
@ -8832,9 +8817,9 @@ dependencies = [
[[package]]
name = "zbus"
version = "4.1.2"
version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9ff46f2a25abd690ed072054733e0bc3157e3d4c45f41bd183dce09c2ff8ab9"
checksum = "6aea58d1af0aaa8abf87f3d9ade9b8f46bf13727e5f9fb24bc31ee9d94a9b4ad"
dependencies = [
"async-broadcast",
"async-executor",
@ -8846,7 +8831,6 @@ dependencies = [
"async-task",
"async-trait",
"blocking",
"derivative",
"enumflags2",
"event-listener 5.3.0",
"futures-core",
@ -8872,14 +8856,13 @@ dependencies = [
[[package]]
name = "zbus_macros"
version = "4.1.2"
version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e0e3852c93dcdb49c9462afe67a2a468f7bd464150d866e861eaf06208633e0"
checksum = "1bf2b496ec1e2d3c4a7878e351607f7a2bec1e1029b353683dfc28a22999e369"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
"regex",
"syn 1.0.109",
"zvariant_utils",
]
@ -8986,9 +8969,9 @@ dependencies = [
[[package]]
name = "zvariant"
version = "4.0.2"
version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c1b3ca6db667bfada0f1ebfc94b2b1759ba25472ee5373d4551bb892616389a"
checksum = "4e9282c6945d9e27742ba7ad7191325546636295de7b83f6735af73159b32ac7"
dependencies = [
"endi",
"enumflags2",
@ -9000,9 +8983,9 @@ dependencies = [
[[package]]
name = "zvariant_derive"
version = "4.0.2"
version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7a4b236063316163b69039f77ce3117accb41a09567fd24c168e43491e521bc"
checksum = "0142549e559746ff09d194dd43d256a554299d286cc56460a082b8ae24652aa1"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
@ -9013,9 +8996,9 @@ dependencies = [
[[package]]
name = "zvariant_utils"
version = "1.1.0"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172"
checksum = "75fa7291bdd68cd13c4f97cc9d78cbf16d96305856dfc7ac942aeff4c2de7d5a"
dependencies = [
"proc-macro2",
"quote",

File diff suppressed because one or more lines are too long

View file

@ -1693,6 +1693,13 @@
"window:allow-current-monitor"
]
},
{
"description": "window:allow-cursor-position -> Enables the cursor_position command without any pre-configured scope.",
"type": "string",
"enum": [
"window:allow-cursor-position"
]
},
{
"description": "window:allow-destroy -> Enables the destroy command without any pre-configured scope.",
"type": "string",
@ -2120,6 +2127,13 @@
"window:deny-current-monitor"
]
},
{
"description": "window:deny-cursor-position -> Denies the cursor_position command without any pre-configured scope.",
"type": "string",
"enum": [
"window:deny-cursor-position"
]
},
{
"description": "window:deny-destroy -> Denies the destroy command without any pre-configured scope.",
"type": "string",

View file

@ -1693,6 +1693,13 @@
"window:allow-current-monitor"
]
},
{
"description": "window:allow-cursor-position -> Enables the cursor_position command without any pre-configured scope.",
"type": "string",
"enum": [
"window:allow-cursor-position"
]
},
{
"description": "window:allow-destroy -> Enables the destroy command without any pre-configured scope.",
"type": "string",
@ -2120,6 +2127,13 @@
"window:deny-current-monitor"
]
},
{
"description": "window:deny-cursor-position -> Denies the cursor_position command without any pre-configured scope.",
"type": "string",
"enum": [
"window:deny-cursor-position"
]
},
{
"description": "window:deny-destroy -> Denies the destroy command without any pre-configured scope.",
"type": "string",