Skip to content

Commit 121774f

Browse files
authored
Merge pull request #30 from kernel/release-please--branches--main--changes--next
release: 0.15.0
2 parents 9cd8f5c + 1c955f0 commit 121774f

10 files changed

Lines changed: 259 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,33 @@ on:
1313
- 'stl-preview-base/**'
1414

1515
jobs:
16+
build:
17+
timeout-minutes: 10
18+
name: build
19+
permissions:
20+
contents: read
21+
id-token: write
22+
runs-on: ${{ github.repository == 'stainless-sdks/hypeman-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
23+
if: |-
24+
github.repository == 'stainless-sdks/hypeman-go' &&
25+
(github.event_name == 'push' || github.event.pull_request.head.repo.fork)
26+
steps:
27+
- uses: actions/checkout@v6
28+
29+
- name: Get GitHub OIDC Token
30+
if: github.repository == 'stainless-sdks/hypeman-go'
31+
id: github-oidc
32+
uses: actions/github-script@v8
33+
with:
34+
script: core.setOutput('github_token', await core.getIDToken());
35+
36+
- name: Upload tarball
37+
if: github.repository == 'stainless-sdks/hypeman-go'
38+
env:
39+
URL: https://pkg.stainless.com/s
40+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
41+
SHA: ${{ github.sha }}
42+
run: ./scripts/utils/upload-artifact.sh
1643
lint:
1744
timeout-minutes: 10
1845
name: lint

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.14.0"
2+
".": "0.15.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 37
1+
configured_endpoints: 39
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-68bd472fc1704fc7ff7ed01b4213dda068a0865d42693d47ecef90651526febb.yml
33
openapi_spec_hash: 18ec995954b05d8dfb1e9e3254cf579a
4-
config_hash: d452c139da1e46a44a68b91e8a40de72
4+
config_hash: 368f8c9248e41f12124ab83b6f5b2eec

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.15.0 (2026-03-04)
4+
5+
Full Changelog: [v0.14.0...v0.15.0](https://github.com/kernel/hypeman-go/compare/v0.14.0...v0.15.0)
6+
7+
### Features
8+
9+
* Add fork operation to stainless config ([5ab52b7](https://github.com/kernel/hypeman-go/commit/5ab52b7c74031eb7e874615aa42c00090cb00b51))
10+
11+
12+
### Chores
13+
14+
* **internal:** codegen related update ([83363a5](https://github.com/kernel/hypeman-go/commit/83363a5275d88e131d0736516fea215faaab84a7))
15+
316
## 0.14.0 (2026-03-02)
417

518
Full Changelog: [v0.13.0...v0.14.0](https://github.com/kernel/hypeman-go/compare/v0.13.0...v0.14.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Or to pin the version:
2828
<!-- x-release-please-start-version -->
2929

3030
```sh
31-
go get -u 'github.com/kernel/hypeman-go@v0.14.0'
31+
go get -u 'github.com/kernel/hypeman-go@v0.15.0'
3232
```
3333

3434
<!-- x-release-please-end -->

api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Params Types:
3030
Response Types:
3131

3232
- <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>
33+
- <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceStats">InstanceStats</a>
3334
- <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#PathInfo">PathInfo</a>
3435
- <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#VolumeMount">VolumeMount</a>
3536

@@ -38,12 +39,14 @@ Methods:
3839
- <code title="post /instances">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceNewParams">InstanceNewParams</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
3940
- <code title="get /instances">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceListParams">InstanceListParams</a>) (\*[]<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4041
- <code title="delete /instances/{id}">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
42+
- <code title="post /instances/{id}/fork">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Fork">Fork</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceForkParams">InstanceForkParams</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4143
- <code title="get /instances/{id}">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4244
- <code title="get /instances/{id}/logs">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Logs">Logs</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceLogsParams">InstanceLogsParams</a>) (\*<a href="https://pkg.go.dev/builtin#string">string</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4345
- <code title="post /instances/{id}/restore">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Restore">Restore</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4446
- <code title="post /instances/{id}/standby">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Standby">Standby</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4547
- <code title="post /instances/{id}/start">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Start">Start</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceStartParams">InstanceStartParams</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4648
- <code title="get /instances/{id}/stat">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Stat">Stat</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceStatParams">InstanceStatParams</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#PathInfo">PathInfo</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
49+
- <code title="get /instances/{id}/stats">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Stats">Stats</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceStats">InstanceStats</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4750
- <code title="post /instances/{id}/stop">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Stop">Stop</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4851

4952
## Volumes

instance.go

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ func (r *InstanceService) Delete(ctx context.Context, id string, opts ...option.
7171
return
7272
}
7373

74+
// Fork an instance from stopped, standby, or running (with from_running=true)
75+
func (r *InstanceService) Fork(ctx context.Context, id string, body InstanceForkParams, opts ...option.RequestOption) (res *Instance, err error) {
76+
opts = slices.Concat(r.Options, opts)
77+
if id == "" {
78+
err = errors.New("missing required id parameter")
79+
return
80+
}
81+
path := fmt.Sprintf("instances/%s/fork", id)
82+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
83+
return
84+
}
85+
7486
// Get instance details
7587
func (r *InstanceService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Instance, err error) {
7688
opts = slices.Concat(r.Options, opts)
@@ -157,6 +169,20 @@ func (r *InstanceService) Stat(ctx context.Context, id string, query InstanceSta
157169
return
158170
}
159171

172+
// Returns real-time resource utilization statistics for a running VM instance.
173+
// Metrics are collected from /proc/<pid>/stat and /proc/<pid>/statm for CPU and
174+
// memory, and from TAP interface statistics for network I/O.
175+
func (r *InstanceService) Stats(ctx context.Context, id string, opts ...option.RequestOption) (res *InstanceStats, err error) {
176+
opts = slices.Concat(r.Options, opts)
177+
if id == "" {
178+
err = errors.New("missing required id parameter")
179+
return
180+
}
181+
path := fmt.Sprintf("instances/%s/stats", id)
182+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
183+
return
184+
}
185+
160186
// Stop instance (graceful shutdown)
161187
func (r *InstanceService) Stop(ctx context.Context, id string, opts ...option.RequestOption) (res *Instance, err error) {
162188
opts = slices.Concat(r.Options, opts)
@@ -348,6 +374,52 @@ func (r *InstanceNetwork) UnmarshalJSON(data []byte) error {
348374
return apijson.UnmarshalRoot(data, r)
349375
}
350376

377+
// Real-time resource utilization statistics for a VM instance
378+
type InstanceStats struct {
379+
// Total memory allocated to the VM (Size + HotplugSize) in bytes
380+
AllocatedMemoryBytes int64 `json:"allocated_memory_bytes" api:"required"`
381+
// Number of vCPUs allocated to the VM
382+
AllocatedVcpus int64 `json:"allocated_vcpus" api:"required"`
383+
// Total CPU time consumed by the VM hypervisor process in seconds
384+
CPUSeconds float64 `json:"cpu_seconds" api:"required"`
385+
// Instance identifier
386+
InstanceID string `json:"instance_id" api:"required"`
387+
// Instance name
388+
InstanceName string `json:"instance_name" api:"required"`
389+
// Resident Set Size - actual physical memory used by the VM in bytes
390+
MemoryRssBytes int64 `json:"memory_rss_bytes" api:"required"`
391+
// Virtual Memory Size - total virtual memory allocated in bytes
392+
MemoryVmsBytes int64 `json:"memory_vms_bytes" api:"required"`
393+
// Total network bytes received by the VM (from TAP interface)
394+
NetworkRxBytes int64 `json:"network_rx_bytes" api:"required"`
395+
// Total network bytes transmitted by the VM (from TAP interface)
396+
NetworkTxBytes int64 `json:"network_tx_bytes" api:"required"`
397+
// Memory utilization ratio (RSS / allocated memory). Only present when
398+
// allocated_memory_bytes > 0.
399+
MemoryUtilizationRatio float64 `json:"memory_utilization_ratio" api:"nullable"`
400+
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
401+
JSON struct {
402+
AllocatedMemoryBytes respjson.Field
403+
AllocatedVcpus respjson.Field
404+
CPUSeconds respjson.Field
405+
InstanceID respjson.Field
406+
InstanceName respjson.Field
407+
MemoryRssBytes respjson.Field
408+
MemoryVmsBytes respjson.Field
409+
NetworkRxBytes respjson.Field
410+
NetworkTxBytes respjson.Field
411+
MemoryUtilizationRatio respjson.Field
412+
ExtraFields map[string]respjson.Field
413+
raw string
414+
} `json:"-"`
415+
}
416+
417+
// Returns the unmodified JSON received from the API
418+
func (r InstanceStats) RawJSON() string { return r.JSON.raw }
419+
func (r *InstanceStats) UnmarshalJSON(data []byte) error {
420+
return apijson.UnmarshalRoot(data, r)
421+
}
422+
351423
type PathInfo struct {
352424
// Whether the path exists
353425
Exists bool `json:"exists" api:"required"`
@@ -590,6 +662,41 @@ const (
590662
InstanceListParamsStateUnknown InstanceListParamsState = "Unknown"
591663
)
592664

665+
type InstanceForkParams struct {
666+
// Name for the forked instance (lowercase letters, digits, and dashes only; cannot
667+
// start or end with a dash)
668+
Name string `json:"name" api:"required"`
669+
// Allow forking from a running source instance. When true and source is Running,
670+
// the source is put into standby, forked, then restored back to Running.
671+
FromRunning param.Opt[bool] `json:"from_running,omitzero"`
672+
// Optional final state for the forked instance. Default is the source instance
673+
// state at fork time. For example, forking from Running defaults the fork result
674+
// to Running.
675+
//
676+
// Any of "Stopped", "Standby", "Running".
677+
TargetState InstanceForkParamsTargetState `json:"target_state,omitzero"`
678+
paramObj
679+
}
680+
681+
func (r InstanceForkParams) MarshalJSON() (data []byte, err error) {
682+
type shadow InstanceForkParams
683+
return param.MarshalObject(r, (*shadow)(&r))
684+
}
685+
func (r *InstanceForkParams) UnmarshalJSON(data []byte) error {
686+
return apijson.UnmarshalRoot(data, r)
687+
}
688+
689+
// Optional final state for the forked instance. Default is the source instance
690+
// state at fork time. For example, forking from Running defaults the fork result
691+
// to Running.
692+
type InstanceForkParamsTargetState string
693+
694+
const (
695+
InstanceForkParamsTargetStateStopped InstanceForkParamsTargetState = "Stopped"
696+
InstanceForkParamsTargetStateStandby InstanceForkParamsTargetState = "Standby"
697+
InstanceForkParamsTargetStateRunning InstanceForkParamsTargetState = "Running"
698+
)
699+
593700
type InstanceLogsParams struct {
594701
// Continue streaming new lines after initial output
595702
Follow param.Opt[bool] `query:"follow,omitzero" json:"-"`

instance_test.go

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,37 @@ func TestInstanceDelete(t *testing.T) {
124124
}
125125
}
126126

127+
func TestInstanceForkWithOptionalParams(t *testing.T) {
128+
t.Skip("Mock server tests are disabled")
129+
baseURL := "http://localhost:4010"
130+
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
131+
baseURL = envURL
132+
}
133+
if !testutil.CheckTestServer(t, baseURL) {
134+
return
135+
}
136+
client := hypeman.NewClient(
137+
option.WithBaseURL(baseURL),
138+
option.WithAPIKey("My API Key"),
139+
)
140+
_, err := client.Instances.Fork(
141+
context.TODO(),
142+
"id",
143+
hypeman.InstanceForkParams{
144+
Name: "my-workload-1-fork",
145+
FromRunning: hypeman.Bool(false),
146+
TargetState: hypeman.InstanceForkParamsTargetStateRunning,
147+
},
148+
)
149+
if err != nil {
150+
var apierr *hypeman.Error
151+
if errors.As(err, &apierr) {
152+
t.Log(string(apierr.DumpRequest(true)))
153+
}
154+
t.Fatalf("err should be nil: %s", err.Error())
155+
}
156+
}
157+
127158
func TestInstanceGet(t *testing.T) {
128159
t.Skip("Mock server tests are disabled")
129160
baseURL := "http://localhost:4010"
@@ -253,6 +284,29 @@ func TestInstanceStatWithOptionalParams(t *testing.T) {
253284
}
254285
}
255286

287+
func TestInstanceStats(t *testing.T) {
288+
t.Skip("Mock server tests are disabled")
289+
baseURL := "http://localhost:4010"
290+
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
291+
baseURL = envURL
292+
}
293+
if !testutil.CheckTestServer(t, baseURL) {
294+
return
295+
}
296+
client := hypeman.NewClient(
297+
option.WithBaseURL(baseURL),
298+
option.WithAPIKey("My API Key"),
299+
)
300+
_, err := client.Instances.Stats(context.TODO(), "id")
301+
if err != nil {
302+
var apierr *hypeman.Error
303+
if errors.As(err, &apierr) {
304+
t.Log(string(apierr.DumpRequest(true)))
305+
}
306+
t.Fatalf("err should be nil: %s", err.Error())
307+
}
308+
}
309+
256310
func TestInstanceStop(t *testing.T) {
257311
t.Skip("Mock server tests are disabled")
258312
baseURL := "http://localhost:4010"

internal/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
package internal
44

5-
const PackageVersion = "0.14.0" // x-release-please-version
5+
const PackageVersion = "0.15.0" // x-release-please-version

scripts/utils/upload-artifact.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
set -exuo pipefail
3+
4+
DIST_DIR="dist"
5+
FILENAME="source.zip"
6+
7+
mapfile -d '' files < <(
8+
find . -type f \
9+
\( -name '*.go' -o -name 'go.mod' -o -name 'go.sum' \) \
10+
! -path "./${DIST_DIR}/*" \
11+
-print0
12+
)
13+
14+
if [[ ${#files[@]} -eq 0 ]]; then
15+
echo -e "\033[31mNo Go source files found for packaging.\033[0m"
16+
exit 1
17+
fi
18+
19+
mkdir -p "$DIST_DIR"
20+
rm -f "${DIST_DIR}/${FILENAME}"
21+
22+
relative_files=()
23+
for file in "${files[@]}"; do
24+
relative_files+=("${file#./}")
25+
done
26+
27+
zip "${DIST_DIR}/${FILENAME}" "${relative_files[@]}"
28+
29+
RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
30+
-H "Authorization: Bearer $AUTH" \
31+
-H "Content-Type: application/json")
32+
33+
SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
34+
35+
if [[ "$SIGNED_URL" == "null" ]]; then
36+
echo -e "\033[31mFailed to get signed URL.\033[0m"
37+
exit 1
38+
fi
39+
40+
UPLOAD_RESPONSE=$(curl -v -X PUT \
41+
-H "Content-Type: application/zip" \
42+
--data-binary "@${DIST_DIR}/${FILENAME}" "$SIGNED_URL" 2>&1)
43+
44+
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
45+
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
46+
echo -e "\033[32mInstallation: Download and unzip: 'https://pkg.stainless.com/s/hypeman-go/$SHA'. Run 'go mod edit -replace github.com/kernel/hypeman-go=/path/to/unzipped_directory'.\033[0m"
47+
else
48+
echo -e "\033[31mFailed to upload artifact.\033[0m"
49+
exit 1
50+
fi

0 commit comments

Comments
 (0)