-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (47 loc) · 1.55 KB
/
build_lib.yaml
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
name: Build lib
on:
workflow_call:
jobs:
build_lib:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install poetry
run: pip install poetry
- name: Make versions
run: |
chmod +x ./tools/version.sh
./tools/version.sh "${{ github.sha }}" "none"
echo "APP_VERSION=$(cat "./VERSION")" >> $GITHUB_ENV
echo "DOCKER_IMAGES=$(cat "./DOCKER_IMAGES")" >> $GITHUB_ENV
- name: Install dependencies
run: |
poetry config virtualenvs.in-project true
poetry install --no-root --with dev
- name: Build package
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry build
- name: Publish to pypi
# The version in PyPI must follow the PEP 440 standard.
# Semantic versioning is not supported by PyPI.
# Therefore, only the release version is published.
run: |
if [[ ${{ github.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
poetry publish
fi
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Create a github release
run: gh release create "${{ env.APP_VERSION }}" ./dist/*
env:
GH_TOKEN: ${{ github.token }}