From 942891248da8829371a3fc557b759a4595a88933 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 30 Jun 2023 17:32:44 +0200 Subject: [PATCH] Improve script to prepare for flatpak release --- build-flatpak.sh => prepare-flatpak.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename build-flatpak.sh => prepare-flatpak.sh (52%) diff --git a/build-flatpak.sh b/prepare-flatpak.sh similarity index 52% rename from build-flatpak.sh rename to prepare-flatpak.sh index 606efe5..3a5fc81 100755 --- a/build-flatpak.sh +++ b/prepare-flatpak.sh @@ -1,12 +1,20 @@ # Usage ./build-flatpak.sh -# First run `cargo vendor` and add the output to ~/.cargo/config.toml +# download and save the vendored crates +mkdir .cargo +cargo vendor >> .cargo/config.toml + +# get the current version for the file name VERSION=$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name | test("lemoa")) | .version') rm -rf target _build build builddir cd .. + +# archive the source code and vendored crates to a tar.xz tar cfJ "lemoa-$VERSION.tar.xz" lemoa -sha256sum "lemoa-$VERSION.tar.xz" +sha256sum "lemoa-$VERSION.tar.xz" | cut -d ' ' -f 1 + +# cleanup cd lemoa git reset --hard &> /dev/null rm -rf vendor .cargo