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