Skip to content

Publish SDK

Publish SDK #138

Workflow file for this run

name: Publish SDK
on:
push:
branches:
- main
paths:
- 'sdks/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball for each sdk
run: |
chmod +x ./scripts/build_sdk.sh
./scripts/build_sdk.sh
shell: bash
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: packages/
- name: Send success notification
if: ${{ success() }}
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
status: "${{ job.status }}"
channel: "C02J0CWR789"
username: "sdk-generation-bot"
color: "#80FF00"
text: "Python SDK publishing succeeded. <https://github.com/criteo/criteo-api-java-sdk/actions/runs/${{github.run_id}}|Link to build>."
icon_emoji: ":green_check_mark:"
- name: Send failure notification
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
status: "${{ job.status }}"
channel: "C02J0CWR789"
username: "sdk-generation-bot"
color: "#FF0000"
text: "Python SDK publishing failed. <https://github.com/criteo/criteo-api-java-sdk/actions/runs/${{github.run_id}}|Link to build>."
icon_emoji: ":x:"