Skip to content

Commit

Permalink
CI: consolidate GH action cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Dec 14, 2023
1 parent b46e5e0 commit de8c2e2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
7 changes: 7 additions & 0 deletions e2e/run_all_tests
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
FILES=$(find e2e -name 'test_*' -type f -not -path "*/.rtx/*" | sort)
test_count=0
if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
{
echo "### E2E Test Tranche $TEST_TRANCHE/$TEST_TRANCHE_COUNT"
echo "| Test | Duration |"
echo "| ---- | -------- |"
} >> "$GITHUB_STEP_SUMMARY"
fi
for f in $FILES; do
# split tests into two tranches to reduce test time
if [ -n "${TEST_TRANCHE_COUNT:-}" ]; then
Expand Down
7 changes: 6 additions & 1 deletion e2e/run_test
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ setup_config_files() {
}

run_test() {
echo "Running $TEST"
echo "::group::E2E $TEST"
rm -f "$RTX_CONFIG_FILE"
cd "$(dirname "$TEST")"

Expand All @@ -39,6 +39,11 @@ run_test() {
END=$(date +%s)

echo "$TEST: $((END - START))s"
echo "::endgroup::"
if [[ -z "${GITHUB_STEP_SUMMARY:-}" ]]; then
return
fi
echo "| $TEST | $((END - START))s |" >> "$GITHUB_STEP_SUMMARY"
}

setup_env
Expand Down
17 changes: 16 additions & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euxo pipefail

echo "::group::Setup"
git config --global user.name rtx-vm
git config --global user.email [email protected]

Expand All @@ -10,7 +11,9 @@ RELEASE_DIR=releases
export BASE_DIR RTX_VERSION RELEASE_DIR
rm -rf "${RELEASE_DIR:?}/$RTX_VERSION"
mkdir -p "$RELEASE_DIR/$RTX_VERSION"
echo "::endgroup::"

echo "::group::Build"
find artifacts -name 'tarball-*' -exec sh -c '
target=${1#artifacts/tarball-}
cp "artifacts/tarball-$target/"*.tar.gz "$RELEASE_DIR/$RTX_VERSION"
Expand All @@ -36,7 +39,9 @@ for platform in "${platforms[@]}"; do
cp -v rtx/bin/rtx "$RELEASE_DIR/rtx-latest-$platform"
cp -v rtx/bin/rtx "$RELEASE_DIR/$RTX_VERSION/rtx-$RTX_VERSION-$platform"
done
echo "::endgroup::"

echo "::group::Checksums"
pushd "$RELEASE_DIR"
echo "$RTX_VERSION" | tr -d 'v' >VERSION
cp rtx-latest-linux-x64 rtx-latest-linux-amd64
Expand All @@ -53,20 +58,30 @@ sha512sum ./* >SHASUMS512.txt
gpg --clearsign -u 408B88DB29DDE9E0 <SHASUMS256.txt >SHASUMS256.asc
gpg --clearsign -u 408B88DB29DDE9E0 <SHASUMS512.txt >SHASUMS512.asc
popd
echo "::endgroup::"

echo "::group::install.sh"
./rtx/scripts/render-install.sh >"$RELEASE_DIR"/install.sh
chmod +x "$RELEASE_DIR"/install.sh
shellcheck "$RELEASE_DIR"/install.sh
gpg -u 408B88DB29DDE9E0 --output "$RELEASE_DIR"/install.sh.sig --sign "$RELEASE_DIR"/install.sh
echo "::endgroup::"

if [[ "$DRY_RUN" != 1 ]]; then
echo "::group::Publish npm @jdxcode/rtx"
NPM_PREFIX=@jdxcode/rtx ./rtx/scripts/release-npm.sh
echo "::endgroup::"
echo "::group::Publish npm rtx-cli"
NPM_PREFIX=rtx-cli ./rtx/scripts/release-npm.sh
#AWS_S3_BUCKET=rtx.jdx.dev ./rtx/scripts/publish-s3.sh
echo "::endgroup::"
echo "::group::Publish r2"
./rtx/scripts/publish-r2.sh
echo "::endgroup::"
fi

echo "::group::Publish homebrew"
./rtx/scripts/render-homebrew.sh >homebrew-tap/rtx.rb
pushd homebrew-tap
git add . && git commit -m "rtx ${RTX_VERSION#v}"
popd
echo "::endgroup::"

0 comments on commit de8c2e2

Please sign in to comment.