-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (51 loc) · 1.56 KB
/
actions.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
name: Publish ContextQA release to PyPI
on:
release:
types: [published]
jobs:
build-n-publish:
name: Build and publish
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
# Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
# Install npm dependencies for client
- name: Install client dependencies
run: npm install
working-directory: client
# Build client application
- name: Build client UI
run: npm run build
working-directory: client
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install pypa/setuptools
run: >-
python -m
pip install wheel pipenv twine
- name: Generate requirements
run: |
pipenv requirements > requirements.txt
sed -i '1d' requirements.txt
working-directory: api
- name: Extract tag name
id: tag
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.py
run: |
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py
working-directory: api
- name: Final build
run: >-
python setup.py sdist bdist_wheel
working-directory: api
- name: Publish to PyPI
run: |
twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
working-directory: api