-
Notifications
You must be signed in to change notification settings - Fork 26
46 lines (37 loc) · 1.05 KB
/
build-and-publish.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
name: DSG build and deploy to pypi
# Only trigger, when the build workflow succeeded
on:
push:
tags:
- '*'
jobs:
build-publish:
name: Build, Publish
runs-on: ubuntu-latest
environment: production
strategy:
max-parallel: 4
matrix:
python-version: ["3.10"]
include:
- db: postgres
db_port: 5432
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pip dependencies
if: steps.pip-cache.outputs.cache-hit != 'true'
run: |
pip install psycopg2 'poetry<3.0.0' proto-parser
- name: Install poetry
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install
- name: build and publish
run: |
echo ${{github.ref_name}}
echo $GITHUB_REF_NAME
sed -i 's/version = "0.1.1"/version = "'$GITHUB_REF_NAME'"/g' pyproject.toml
poetry build
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish