mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-05-06 00:12:28 +00:00
chore(ci): change upload type
This commit is contained in:
parent
8b23bb2bb1
commit
3afcacf5f9
2 changed files with 23 additions and 7 deletions
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
|
|
@ -35,10 +35,10 @@ jobs:
|
|||
- name: Run lints
|
||||
run: ./scripts/lint
|
||||
|
||||
upload:
|
||||
build:
|
||||
if: github.repository == 'stainless-sdks/opencode-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
|
||||
timeout-minutes: 10
|
||||
name: upload
|
||||
name: build
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
|
@ -46,6 +46,20 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rye
|
||||
run: |
|
||||
curl -sSf https://rye.astral.sh/get | bash
|
||||
echo "$HOME/.rye/shims" >> $GITHUB_PATH
|
||||
env:
|
||||
RYE_VERSION: '0.44.0'
|
||||
RYE_INSTALL_OPTION: '--yes'
|
||||
|
||||
- name: Install dependencies
|
||||
run: rye sync --all-features
|
||||
|
||||
- name: Run build
|
||||
run: rye build
|
||||
|
||||
- name: Get GitHub OIDC Token
|
||||
id: github-oidc
|
||||
uses: actions/github-script@v6
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
set -exuo pipefail
|
||||
|
||||
RESPONSE=$(curl -X POST "$URL" \
|
||||
FILENAME=$(basename dist/*.whl)
|
||||
|
||||
RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
|
||||
-H "Authorization: Bearer $AUTH" \
|
||||
-H "Content-Type: application/json")
|
||||
|
||||
|
|
@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
|
||||
-H "Content-Type: application/gzip" \
|
||||
--data-binary @- "$SIGNED_URL" 2>&1)
|
||||
UPLOAD_RESPONSE=$(curl -v -X PUT \
|
||||
-H "Content-Type: binary/octet-stream" \
|
||||
--data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1)
|
||||
|
||||
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
|
||||
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
|
||||
echo -e "\033[32mInstallation: pip install --pre 'https://pkg.stainless.com/s/opencode-python/$SHA'\033[0m"
|
||||
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/opencode-python/$SHA/$FILENAME'\033[0m"
|
||||
else
|
||||
echo -e "\033[31mFailed to upload artifact.\033[0m"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue