1
0
mirror of https://github.com/pcvolkmer/cert-tools.git synced 2025-07-01 14:02:54 +00:00

build: use generated version on package build

This commit is contained in:
2025-01-25 17:14:49 +01:00
parent a777289dcc
commit 274cb89af7
3 changed files with 19 additions and 3 deletions

View File

@ -46,13 +46,29 @@ binary-all: win-binary-x86_64 linux-binary-x86_64
.PHONY: win-binary-x86_64
win-binary-x86_64:
# Temp cargo file
cp Cargo.toml Cargo.toml.0
cp ui/Cargo.toml ui/Cargo.toml.0
sed -i 's/^version.*/version = $(VERSION)/' Cargo.toml
sed -i 's/^version = .*/version = $(VERSION)/' ui/Cargo.toml
cargo build --release --target=x86_64-pc-windows-gnu
cargo build --release --package cert-tools-ui --target=x86_64-pc-windows-gnu
# Restore temp
mv Cargo.toml.0 Cargo.toml
mv ui/Cargo.toml.0 ui/Cargo.toml
.PHONY: linux-binary-x86_64
linux-binary-x86_64:
# Temp cargo file
cp Cargo.toml Cargo.toml.0
cp ui/Cargo.toml ui/Cargo.toml.0
sed -i 's/^version.*/version = $(VERSION)/' Cargo.toml
sed -i 's/^version = .*/version = $(VERSION)/' ui/Cargo.toml
cargo build --release --target=x86_64-unknown-linux-gnu
cargo build --release --package cert-tools-ui --target=x86_64-unknown-linux-gnu
# Restore temp
mv Cargo.toml.0 Cargo.toml
mv ui/Cargo.toml.0 ui/Cargo.toml
.PHONY: install
install: