Merge pull request #19 from omkararyaai/dlb_v2 #22
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to PyPI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - '*.*.*' | |
| - '!*.*.dev*' | |
| jobs: | |
| pypi: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch tags | |
| run: git fetch --prune --tags | |
| # (optional but recommended) Pin Python version | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| # 🔧 NEW: make sure packaging / build stack are up to date | |
| - name: Install build tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools wheel | |
| python -m pip install --upgrade build twine packaging | |
| # (optional) clean old build artefacts, just in case | |
| - name: Clean build artefacts | |
| run: rm -rf dist build ./*.egg-info | |
| - name: Get Release Notes | |
| id: release_notes | |
| run: | | |
| TAG_NAME=$(gh release view --json tagName | jq -r .tagName) | |
| RELEASE_NOTES=$(gh release view --json url | jq -r .url) | |
| RELEASE_NOTES="${RELEASE_NOTES//$'\n'/\\n}" | |
| echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT | |
| echo "RELEASE_NOTES=${RELEASE_NOTES}" >> $GITHUB_OUTPUT | |
| env: | |
| GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish package to PyPI | |
| run: python -m twine upload dist/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| - name: Send release notes to Slack | |
| id: slack | |
| uses: slackapi/slack-github-action@v1.24.0 | |
| with: | |
| channel-id: 'aryaxai-dl-backtrace-release' | |
| payload: | | |
| { | |
| "text": "AryaXAI SDK release", | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "*Version:* ${{ steps.release_notes.outputs.TAG_NAME }}" | |
| } | |
| }, | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "*Release Notes:* ${{ steps.release_notes.outputs.RELEASE_NOTES }}" | |
| } | |
| }, | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "*PyPI URL:* https://pypi.org/project/dl-backtrace/${{ steps.release_notes.outputs.TAG_NAME }}" | |
| } | |
| } | |
| ] | |
| } | |
| env: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |