Skip to content

Commit 49cdc9c

Browse files
chore(ci): change upload type
1 parent f616411 commit 49cdc9c

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff 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/openlayer-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

scripts/utils/upload-artifact.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22
set -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
1315
fi
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

1921
if 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/openlayer-python/$SHA'\033[0m"
23+
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/openlayer-python/$SHA/$FILENAME'\033[0m"
2224
else
2325
echo -e "\033[31mFailed to upload artifact.\033[0m"
2426
exit 1

0 commit comments

Comments
 (0)