Skip to content

Commit

Permalink
feat: add update mechanism
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Griffon <anthony@griffon.one>
  • Loading branch information
Miaxos committed Nov 30, 2023
1 parent cb29002 commit 407255e
Show file tree
Hide file tree
Showing 8 changed files with 336 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
test_project/
deployment/
191 changes: 191 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions ci/build-m1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# From ripgrep: https://github.com/BurntSushi/ripgrep/blob/84d65865e6febc784b8b0296dd4681d761fa5a67/ci/build-and-publish-m2#L3
# This script builds a swarmd release for the aarch64-apple-darwin target.
#
# Once GitHub Actions has proper support for Apple silicon, we should add it
# to our release workflow and drop this script.

set -e

version="$1"
if [ -z "$version" ]; then
echo "missing version" >&2
echo "Usage: "$(basename "$0")" <version>" >&2
exit 1
fi

target=aarch64-apple-darwin
OPENSSL_STATIC=1 cargo build --bin swarmd --release --target $target
BIN=target/$target/release/swarmd
NAME=swarmd-$version-$target
ARCHIVE="deployment/m1/$NAME"

mkdir -p "$ARCHIVE"/doc
cp "$BIN" "$ARCHIVE"/
strip "$ARCHIVE/swarmd"
cp cli/README.md "$ARCHIVE"/
cp cli/CHANGELOG.md "$ARCHIVE"/doc/
# "$BIN" --generate complete-bash > "$ARCHIVE/complete/rg.bash"
# "$BIN" --generate complete-fish > "$ARCHIVE/complete/rg.fish"
# "$BIN" --generate complete-powershell > "$ARCHIVE/complete/_rg.ps1"
# "$BIN" --generate complete-zsh > "$ARCHIVE/complete/_rg"
# "$BIN" --generate man > "$ARCHIVE/doc/rg.1"

# tar czf "$ARCHIVE.tar.gz" "$NAME"
tar czvf "$ARCHIVE.tar.gz" -C deployment/m1 "$NAME"
shasum -a 256 "$ARCHIVE.tar.gz" > "$ARCHIVE.tar.gz.sha256"
gh release upload "$version" "$ARCHIVE.tar.gz" "$ARCHIVE.tar.gz.sha256"
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ serde_with = "3"
swarmd_slug-rs.workspace = true
swarmd_generated.workspace = true

self_update = "0.39"
self_update = { version = "0.39", features = ["archive-tar", "compression-flate2"] }

# Log stack
swarmd_instruments.workspace = true
Expand Down
Loading

0 comments on commit 407255e

Please sign in to comment.