Skip to content

Commit

Permalink
Commit from GitHub Actions (test)
Browse files Browse the repository at this point in the history
  • Loading branch information
mise-en-dev committed Mar 16, 2024
1 parent a3e7386 commit 1d77ea8
Show file tree
Hide file tree
Showing 16 changed files with 266 additions and 266 deletions.
56 changes: 28 additions & 28 deletions e2e/assert.sh
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
#!/usr/bin/env bash

assert() {
local actual
actual="$(bash -c "$1")"
if [[ "$actual" != "$2" ]]; then
echo "Expected '$2' but got '$actual'"
exit 1
fi
local actual
actual="$(bash -c "$1")"
if [[ "$actual" != "$2" ]]; then
echo "Expected '$2' but got '$actual'"
exit 1
fi
}

assert_contains() {
local actual
actual="$(bash -c "$1")"
if [[ "$actual" != *"$2"* ]]; then
echo "Expected '$2' to be in '$actual'"
exit 1
fi
local actual
actual="$(bash -c "$1")"
if [[ "$actual" != *"$2"* ]]; then
echo "Expected '$2' to be in '$actual'"
exit 1
fi
}

assert_not_contains() {
local actual
actual="$(bash -c "$1")"
if [[ "$actual" == *"$2"* ]]; then
echo "Expected '$2' to not be in '$actual'"
exit 1
fi
local actual
actual="$(bash -c "$1")"
if [[ "$actual" == *"$2"* ]]; then
echo "Expected '$2' to not be in '$actual'"
exit 1
fi
}

assert_fail() {
if bash -c "$1" 2>&1; then
echo "Expected failure but succeeded"
exit 1
fi
if bash -c "$1" 2>&1; then
echo "Expected failure but succeeded"
exit 1
fi
}

assert_matches() {
local actual
actual="$(bash -c "$1")"
if [[ ! "$actual" =~ $2 ]]; then
echo "Expected '$2' to match '$actual'"
exit 1
fi
local actual
actual="$(bash -c "$1")"
if [[ ! "$actual" =~ $2 ]]; then
echo "Expected '$2' to match '$actual'"
exit 1
fi
}
40 changes: 20 additions & 20 deletions scripts/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ touch mise/lib/.disable-self-update

tar -xvJf "dist/mise-$MISE_VERSION-linux-x64.tar.xz"
fpm -s dir -t deb \
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture amd64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture amd64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1

tar -xvJf "dist/mise-$MISE_VERSION-linux-arm64.tar.xz"
fpm -s dir -t deb \
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture arm64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture arm64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1

mkdir -p dist/deb/pool/main
cp -v ./*.deb dist/deb/pool/main
Expand Down
40 changes: 20 additions & 20 deletions scripts/build-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ touch mise/lib/.disable-self-update

tar -xvJf "dist/mise-$MISE_VERSION-linux-x64.tar.xz"
fpm -s dir -t rpm \
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture x86_64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture x86_64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1

tar -xvJf "dist/mise-$MISE_VERSION-linux-arm64.tar.xz"
fpm -s dir -t rpm \
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture aarch64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture aarch64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1

cat <<EOF >~/.rpmmacros
%_signature gpg
Expand Down
114 changes: 57 additions & 57 deletions scripts/build-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,75 @@
set -euo pipefail

error() {
echo "$@" >&2
exit 1
echo "$@" >&2
exit 1
}

NAME="$1"
shift

for arg in "$@"; do
if [ "${next_target:-}" = 1 ]; then
next_target=
TARGET="$arg"
continue
fi
case "$arg" in
--target)
next_target=1
;;
*) ;;
if [ "${next_target:-}" = 1 ]; then
next_target=
TARGET="$arg"
continue
fi
case "$arg" in
--target)
next_target=1
;;
*) ;;

esac
esac
done

RUST_TRIPLE=${TARGET:-$(rustc -vV | grep ^host: | cut -d ' ' -f2)}
#region os/arch
get_os() {
case "$RUST_TRIPLE" in
*-apple-darwin*)
echo "macos"
;;
*-linux-*)
echo "linux"
;;
*)
error "unsupported OS: $RUST_TRIPLE"
;;
esac
case "$RUST_TRIPLE" in
*-apple-darwin*)
echo "macos"
;;
*-linux-*)
echo "linux"
;;
*)
error "unsupported OS: $RUST_TRIPLE"
;;
esac
}

get_arch() {
case "$RUST_TRIPLE" in
aarch64-*)
echo "arm64"
;;
arm-*)
echo "armv6"
;;
armv7-*)
echo "armv7"
;;
x86_64-*)
echo "x64"
;;
universal2-*)
echo "universal"
;;
*)
error "unsupported arch: $RUST_TRIPLE"
;;
esac
case "$RUST_TRIPLE" in
aarch64-*)
echo "arm64"
;;
arm-*)
echo "armv6"
;;
armv7-*)
echo "armv7"
;;
x86_64-*)
echo "x64"
;;
universal2-*)
echo "universal"
;;
*)
error "unsupported arch: $RUST_TRIPLE"
;;
esac
}
get_suffix() {
case "$RUST_TRIPLE" in
*-musl | *-musleabi | *-musleabihf)
echo "-musl"
;;
*)
echo ""
;;
esac
case "$RUST_TRIPLE" in
*-musl | *-musleabi | *-musleabihf)
echo "-musl"
;;
*)
echo ""
;;
esac
}
#endregion

Expand All @@ -79,11 +79,11 @@ VERSION=$(./scripts/get-version.sh)
BASENAME=$NAME-$VERSION-$(get_os)-$(get_arch)$(get_suffix)

if command -v cross >/dev/null; then
cross build "$@"
cross build "$@"
elif command -v zig >/dev/null; then
cargo zigbuild "$@"
cargo zigbuild "$@"
else
cargo build "$@"
cargo build "$@"
fi
mkdir -p dist/mise/bin
mkdir -p dist/mise/man/man1
Expand All @@ -99,8 +99,8 @@ tar -cJf "$BASENAME.tar.xz" mise
tar -czf "$BASENAME.tar.gz" mise

if [ -f ~/.zipsign/mise.priv ]; then
zipsign sign tar "$BASENAME.tar.gz" ~/.zipsign/mise.priv
zipsign verify tar "$BASENAME.tar.gz" ../zipsign.pub
zipsign sign tar "$BASENAME.tar.gz" ~/.zipsign/mise.priv
zipsign verify tar "$BASENAME.tar.gz" ../zipsign.pub
fi

ls -oh "$BASENAME.tar.xz"
2 changes: 1 addition & 1 deletion scripts/pre-release-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euxo pipefail

if [[ "${NO_UPDATE:-}" == "1" ]]; then
echo "NO_UPDATE is set, skipping update"
echo "NO_UPDATE is set, skipping update"
# else
# cargo update && git add Cargo.lock
fi
Expand Down
18 changes: 9 additions & 9 deletions scripts/publish-s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ export CLOUDFLARE_ACCOUNT_ID=6e243906ff257b965bcae8025c2fc344

# jdx.dev
curl --fail-with-body -X POST "https://api.cloudflare.com/client/v4/zones/90dfd7997bdcfa8579c52d8ee8dd4cd1/purge_cache" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "purge_everything": true }'
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "purge_everything": true }'

# rtx.pub
curl --fail-with-body -X POST "https://api.cloudflare.com/client/v4/zones/80d977fd09f01db52bec165778088891/purge_cache" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "purge_everything": true }'
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "purge_everything": true }'

# mise.run
curl --fail-with-body -X POST "https://api.cloudflare.com/client/v4/zones/782fc08181b7bbd26c529a00df52a277/purge_cache" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "purge_everything": true }'
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "purge_everything": true }'
12 changes: 6 additions & 6 deletions scripts/release-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ apkbuild-lint APKBUILD
git add APKBUILD

if git diff --cached --exit-code; then
echo "No changes to commit"
exit 0
echo "No changes to commit"
exit 0
fi
git commit -m "community/mise: upgrade to ${MISE_VERSION#v}"

if [ "$DRY_RUN" == 0 ]; then
git push jdxcode -f
git push jdxcode -f
fi

open_mr="$(glab mr list -R alpine/aports --author=@me)"
if [[ "$open_mr" != "Showing"* ]]; then
if [ "$DRY_RUN" == 0 ]; then
glab mr create --fill --yes -H jdxcode/aports -R alpine/aports
fi
if [ "$DRY_RUN" == 0 ]; then
glab mr create --fill --yes -H jdxcode/aports -R alpine/aports
fi
fi
#git show
Loading

0 comments on commit 1d77ea8

Please sign in to comment.