Skip to content

Commit cabcfaf

Browse files
authored
fix: use i.captainsafia.sh for install and reduce artifact retention (#35)
* fix: update installation URLs to use i.captainsafia.sh and reduce artifact retention * fix: use package version in PR version
1 parent a771a9d commit cabcfaf

4 files changed

Lines changed: 23 additions & 17 deletions

File tree

.github/workflows/pr-publish.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
run: |
2929
PR_NUMBER=${{ github.event.pull_request.number }}
3030
COMMIT_SHA=${GITHUB_SHA::7}
31-
PR_VERSION="0.0.0-pr.${PR_NUMBER}.${COMMIT_SHA}"
31+
PACKAGE_VERSION=$(jq -r '.version' package.json)
32+
PR_VERSION="${PACKAGE_VERSION}-pr.${PR_NUMBER}.${COMMIT_SHA}"
3233
echo "VERSION=$PR_VERSION" >> $GITHUB_OUTPUT
3334
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT
3435
echo "Generated PR version: ${PR_VERSION}"
@@ -49,7 +50,7 @@ jobs:
4950
path: |
5051
grove-linux-x64
5152
grove-linux-arm64
52-
retention-days: 30
53+
retention-days: 1
5354

5455
build-macos:
5556
runs-on: macos-latest
@@ -151,7 +152,7 @@ jobs:
151152
path: |
152153
grove-darwin-x64
153154
grove-darwin-arm64
154-
retention-days: 30
155+
retention-days: 1
155156

156157
publish-pr:
157158
runs-on: ubuntu-latest
@@ -181,6 +182,13 @@ jobs:
181182
path: ./executables
182183
retention-days: 30
183184

185+
- name: Delete intermediate artifacts
186+
uses: geekyeggo/delete-artifact@v5
187+
with:
188+
name: |
189+
grove-linux-executables
190+
grove-macos-executables
191+
184192
- name: Comment on PR
185193
uses: actions/github-script@v7
186194
with:
@@ -194,7 +202,7 @@ jobs:
194202
195203
**Install with:**
196204
\`\`\`bash
197-
curl -fsSL https://safia.rocks/grove/install.sh | sh -s -- --pr ${prNumber}
205+
curl https://i.captainsafia.sh/captainsafia/grove/pr/${prNumber} | sh
198206
\`\`\`
199207
200208
**Or if you already have grove installed:**

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Grove is a CLI tool that encapsulates the patterns that I use for working with G
2020
### Quick Install (Linux/macOS)
2121

2222
```bash
23-
curl -fsSL https://safia.rocks/grove/install.sh | sh
23+
curl https://i.captainsafia.sh/captainsafia/grove | sh
2424
```
2525

2626
This will download the appropriate binary for your system and install it to `~/.grove/bin`.
@@ -30,7 +30,7 @@ This will download the appropriate binary for your system and install it to `~/.
3030
To install a specific version:
3131

3232
```bash
33-
curl -fsSL https://safia.rocks/grove/install.sh | sh -s -- v1.0.0
33+
curl https://i.captainsafia.sh/captainsafia/grove/v1.0.0 | sh
3434
```
3535

3636
## Usage

site/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ <h2>Manage git worktrees with ease</h2>
434434
</div>
435435

436436
<div class="install-cmd">
437-
<code>curl -fsSL https://safia.rocks/grove/install.sh | sh</code>
437+
<code>curl https://i.captainsafia.sh/captainsafia/grove | sh</code>
438438
</div>
439439

440440
<div class="terminal">

src/commands/self-update.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,21 @@ async function runSelfUpdate(
4646
throw new Error("Invalid version format: must be semver (e.g., v1.0.0 or 1.0.0)");
4747
}
4848

49-
// Construct the install command using argument arrays
50-
const installScriptUrl = "https://safia.rocks/grove/install.sh";
51-
const curlArgs = ["curl", "-fsSL", installScriptUrl];
52-
const shArgs = ["sh"];
49+
// Construct the install command using the i.captainsafia.sh installer
50+
const baseUrl = "https://i.captainsafia.sh/captainsafia/grove";
51+
let installUrl = baseUrl;
5352

54-
// Build the command arguments based on options
53+
// Build the URL based on options
5554
if (options?.pr) {
56-
shArgs.push("-s", "--", "--pr", options.pr);
55+
installUrl = `${baseUrl}/pr/${options.pr}`;
5756
} else if (version) {
5857
// Ensure version starts with 'v'
5958
const versionTag = version.startsWith("v") ? version : `v${version}`;
60-
shArgs.push("-s", "--", versionTag);
59+
installUrl = `${baseUrl}/${versionTag}`;
6160
}
6261

63-
// Combine curl and sh commands with pipe
64-
const commandParts = [...curlArgs, "|", ...shArgs];
65-
const installCommand = commandParts.join(" ");
62+
// Construct the install command
63+
const installCommand = `curl ${installUrl} | sh`;
6664

6765
// Execute the install command
6866
const proc = Bun.spawn(["sh", "-c", installCommand], {

0 commit comments

Comments
 (0)