-
Notifications
You must be signed in to change notification settings - Fork 29
86 lines (76 loc) · 2.56 KB
/
release.yml
File metadata and controls
86 lines (76 loc) · 2.56 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release
on:
release:
types: [released]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
# needed to publish to PyPI
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build
run: |
python -m build
- name: Test the Build
run: |
python -m pip install . # to install dependencies
python -m pip uninstall -y kili
python -m pip install --find-links=dist --no-index kili
python -c 'from kili.client import Kili; k=Kili(); print("Everything OK!")'
env:
KILI_API_ENDPOINT: https://staging.cloud.kili-technology.com/api/label/v2/graphql
KILI_API_KEY: ${{ secrets.KILI_USER_API_KEY_STAGING }}
- name: Make sure we are on a tag
run: |
if [[ ${{ github.ref }} == refs/tags/* ]]; then
echo "We are on a tag"
else
echo "We are not on a tag"
exit 1
fi
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
verbose: true
- name: Slack notification
id: slack
if: success()
uses: slackapi/slack-github-action@v1.25.0
with:
payload: |
{
"text": "Kili SDK ${{ github.ref_name }} released!\nGitHub: https://github.com/kili-technology/kili-python-sdk/releases\nPyPI: https://pypi.org/project/kili/",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Kili SDK ${{ github.ref_name }} released!\nGitHub: https://github.com/kili-technology/kili-python-sdk/releases\nPyPI: https://pypi.org/project/kili/"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_PYTHON_SDK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Set git identity
run: |
git config user.name github-actions
git config user.email github-actions@github.com
deploy-documentation:
uses: ./.github/workflows/deploy_doc.yml
needs: [publish] # Run after the previous job
secrets:
SLACK_WEBHOOK_URL_PYTHON_SDK: ${{ secrets.SLACK_WEBHOOK_URL_PYTHON_SDK }}