Skip to content

Commit 42c0571

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

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
@@ -21,12 +22,16 @@ builds:
2122
- -s
2223
- -w
2324
- -X "github.com/gptscript-ai/gptscript/pkg/version.Tag=v{{ .Version }}"
25+
hooks:
26+
post: ./scripts/copy-cred-helper.sh {{ .Os }} {{ .Arch }}
2427

2528
universal_binaries:
2629
- id: mac
2730
ids:
2831
- default
2932
replace: true
33+
hooks:
34+
post: cp binaries/gptscript-credential-osxkeychain releases/mac_darwin_all
3035

3136
archives:
3237
- id: default
@@ -60,8 +65,9 @@ brews:
6065
- description: "GPTScript CLI"
6166
install: |
6267
bin.install "gptscript"
68+
{{ if eq .Os "darwin" }}bin.install "gptscript-credential-osxkeychain"{{ end }}
6369
homepage: "https://github.com/gptscript-ai/gptscript"
64-
skip_upload: false
70+
skip_upload: true
6571
folder: "Formula"
6672
repository:
6773
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)