-
Notifications
You must be signed in to change notification settings - Fork 12
68 lines (56 loc) · 1.67 KB
/
publish_sdk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Publish SDK
on:
release:
types: [ published ]
env:
PYTHON: 3.8
POETRY: 1.8.3
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
concurrency:
group: cord-client-${{ github.ref }}-publish
cancel-in-progress: true
jobs:
publish-sdk:
name: Publish SDK
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON }}
- name: Setup Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY }}
virtualenvs-in-project: true
- name: Install dependencies
run: |
poetry install --no-interaction
- name: Build SDK
run: poetry build
- name: Publish SDK
run: |
poetry config pypi-token.pypi ${{ env.PYPI_TOKEN }}
poetry publish
send-slack-notification:
name: Send notification
runs-on: ubuntu-20.04
needs: [ publish-sdk ]
if: always()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get workflow status
uses: technote-space/workflow-conclusion-action@v2
- name: Send Slack notification
uses: ./.github/actions/send-slack-notification
with:
success-parameter: ${{ env.WORKFLOW_CONCLUSION }}
success-channel: ${{ secrets.SLACK_DEPLOYMENT_PROD_CHANNEL_ID }}
failure-channel: ${{ secrets.SLACK_FAILURE_CHANNEL_ID }}
success-message: Deployed to https://pypi.org/project/encord/
failure-message: This pipeline has failed!