publish
This commit is contained in:
parent
cbfdf1c8a8
commit
1ed9d1b481
3 changed files with 94 additions and 1 deletions
45
.github/workflows/publish-sdk-python.yml
vendored
Normal file
45
.github/workflows/publish-sdk-python.yml
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
name: Publish Python SDK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'sdk-py-v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to PyPI
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: sdks/python
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
|
||||||
|
- name: Install build tools
|
||||||
|
run: pip install build twine
|
||||||
|
|
||||||
|
- name: Extract version from tag
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
VERSION=${GITHUB_REF_NAME#sdk-py-v}
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Update version in pyproject.toml
|
||||||
|
run: |
|
||||||
|
sed -i "s/^version = .*/version = \"${{ steps.version.outputs.version }}\"/" pyproject.toml
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
run: python -m build
|
||||||
|
|
||||||
|
- name: Publish to PyPI
|
||||||
|
run: twine upload dist/*
|
||||||
|
env:
|
||||||
|
TWINE_USERNAME: __token__
|
||||||
|
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||||
44
.github/workflows/publish-sdk-typescript.yml
vendored
Normal file
44
.github/workflows/publish-sdk-typescript.yml
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
name: Publish TypeScript SDK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'sdk-ts-v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to npm
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: sdks/typescript
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Extract version from tag
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
VERSION=${GITHUB_REF_NAME#sdk-ts-v}
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Update package version
|
||||||
|
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version
|
||||||
|
|
||||||
|
- name: Publish to npm
|
||||||
|
run: npm publish --access public
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
6
.github/workflows/test-integration.yml
vendored
6
.github/workflows/test-integration.yml
vendored
|
|
@ -41,7 +41,11 @@ jobs:
|
||||||
|
|
||||||
- name: Cleanup OpenSearch data (root-owned files)
|
- name: Cleanup OpenSearch data (root-owned files)
|
||||||
run: |
|
run: |
|
||||||
docker run --rm -v $(pwd):/work alpine rm -rf /work/opensearch-data || true
|
for i in 1 2 3; do
|
||||||
|
docker run --rm -v $(pwd):/work alpine rm -rf /work/opensearch-data && break
|
||||||
|
echo "Attempt $i failed, retrying in 5s..."
|
||||||
|
sleep 5
|
||||||
|
done || true
|
||||||
|
|
||||||
- run: df -h
|
- run: df -h
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue