diff --git a/.github/workflows/publish-sdk-python.yml b/.github/workflows/publish-sdk-python.yml new file mode 100644 index 00000000..ac8c9fd9 --- /dev/null +++ b/.github/workflows/publish-sdk-python.yml @@ -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 }} diff --git a/.github/workflows/publish-sdk-typescript.yml b/.github/workflows/publish-sdk-typescript.yml new file mode 100644 index 00000000..7471a5d5 --- /dev/null +++ b/.github/workflows/publish-sdk-typescript.yml @@ -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 }} diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 653cd499..da269b2f 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -41,7 +41,11 @@ jobs: - name: Cleanup OpenSearch data (root-owned files) 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