Skip to content

Commit 1cf538e

Browse files
committed
chore: include gptscript-credential-helpers in packaging
Signed-off-by: Grant Linville <[email protected]>
1 parent c1695f7 commit 1cf538e

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
**/__pycache__
77
/docs/yarn.lock
88
/releases
9+
/binaries
910
/checksums.txt
1011
/.env*

.goreleaser.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ before:
66
hooks:
77
# Generate UI assets to embedded in binaries
88
- make build-ui
9+
- ./scripts/download-cred-helpers.sh
910

1011
builds:
1112
- id: default
@@ -24,12 +25,16 @@ builds:
2425
- -s
2526
- -w
2627
- -X "github.com/gptscript-ai/gptscript/pkg/version.Tag=v{{ .Version }}"
28+
hooks:
29+
post: ./scripts/copy-cred-helper.sh {{ .Os }} {{ .Arch }}
2730

2831
universal_binaries:
2932
- id: mac
3033
ids:
3134
- default
3235
replace: true
36+
hooks:
37+
post: cp binaries/gptscript-credential-osxkeychain releases/mac_darwin_all
3338

3439
archives:
3540
- id: default
@@ -63,8 +68,9 @@ brews:
6368
- description: "GPTScript CLI"
6469
install: |
6570
bin.install "gptscript"
71+
{{ if eq .Os "darwin" }}bin.install "gptscript-credential-osxkeychain"{{ end }}
6672
homepage: "https://github.com/gptscript-ai/gptscript"
67-
skip_upload: false
73+
skip_upload: true
6874
folder: "Formula"
6975
repository:
7076
owner: gptscript-ai

scripts/copy-cred-helper.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
OS="$1"
6+
ARCH="$2"
7+
8+
case "$OS" in
9+
"darwin")
10+
case "$ARCH" in
11+
"amd64")
12+
cp binaries/gptscript-credential-osxkeychain releases/default_darwin_amd64_v1
13+
;;
14+
"arm64")
15+
cp binaries/gptscript-credential-osxkeychain releases/default_darwin_arm64
16+
;;
17+
esac
18+
;;
19+
"windows")
20+
case "$ARCH" in
21+
"amd64")
22+
cp binaries/gptscript-credential-wincred.exe releases/default_windows_amd64_v1
23+
;;
24+
esac
25+
;;
26+
esac

scripts/download-cred-helpers.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# This script downloads the gptscript-credential-helpers. (For use in CI.)
6+
7+
GPTSCRIPT_CRED_HELPERS_VERSION="v0.1.0"
8+
BINARY_DIR="binaries"
9+
10+
mkdir -p "$BINARY_DIR"
11+
cd "$BINARY_DIR"
12+
13+
wget -O gptscript-credential-osxkeychain "https://github.com/gptscript-ai/gptscript-credential-helpers/releases/download/${GPTSCRIPT_CRED_HELPERS_VERSION}/gptscript-credential-osxkeychain"
14+
chmod +x gptscript-credential-osxkeychain
15+
16+
wget -O gptscript-credential-wincred.exe "https://github.com/gptscript-ai/gptscript-credential-helpers/releases/download/${GPTSCRIPT_CRED_HELPERS_VERSION}/gptscript-credential-wincred-${GPTSCRIPT_CRED_HELPERS_VERSION}.windows-amd64.exe"
17+
chmod +x gptscript-credential-wincred.exe

0 commit comments

Comments
 (0)