File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -35,17 +35,31 @@ jobs:
3535 - name : Run lints
3636 run : ./scripts/lint
3737
38- upload :
38+ build :
3939 if : github.repository == 'stainless-sdks/replicate-client-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
4040 timeout-minutes : 10
41- name : upload
41+ name : build
4242 permissions :
4343 contents : read
4444 id-token : write
4545 runs-on : depot-ubuntu-24.04
4646 steps :
4747 - uses : actions/checkout@v4
4848
49+ - name : Install Rye
50+ run : |
51+ curl -sSf https://rye.astral.sh/get | bash
52+ echo "$HOME/.rye/shims" >> $GITHUB_PATH
53+ env :
54+ RYE_VERSION : ' 0.44.0'
55+ RYE_INSTALL_OPTION : ' --yes'
56+
57+ - name : Install dependencies
58+ run : rye sync --all-features
59+
60+ - name : Run build
61+ run : rye build
62+
4963 - name : Get GitHub OIDC Token
5064 id : github-oidc
5165 uses : actions/github-script@v6
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -exuo pipefail
33
4- RESPONSE=$( curl -X POST " $URL " \
4+ FILENAME=$( basename dist/* .whl)
5+
6+ RESPONSE=$( curl -X POST " $URL ?filename=$FILENAME " \
57 -H " Authorization: Bearer $AUTH " \
68 -H " Content-Type: application/json" )
79
@@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
1214 exit 1
1315fi
1416
15- UPLOAD_RESPONSE=$( tar -cz . | curl -v -X PUT \
16- -H " Content-Type: application/gzip " \
17- --data-binary @- " $SIGNED_URL " 2>&1 )
17+ UPLOAD_RESPONSE=$( curl -v -X PUT \
18+ -H " Content-Type: binary/octet-stream " \
19+ --data-binary " @dist/ $FILENAME " " $SIGNED_URL " 2>&1 )
1820
1921if echo " $UPLOAD_RESPONSE " | grep -q " HTTP/[0-9.]* 200" ; then
2022 echo -e " \033[32mUploaded build to Stainless storage.\033[0m"
21- echo -e " \033[32mInstallation: pip install --pre 'https://pkg.stainless.com/s/replicate-client-python/$SHA '\033[0m"
23+ echo -e " \033[32mInstallation: pip install 'https://pkg.stainless.com/s/replicate-client-python/$SHA / $FILENAME '\033[0m"
2224else
2325 echo -e " \033[31mFailed to upload artifact.\033[0m"
2426 exit 1
You can’t perform that action at this time.
0 commit comments