Skip to content

Commit e45783c

Browse files
author
Dmytro Parfeniuk
committed
πŸ‘·β€β™‚οΈ Builds are updated according to a new infrastructure injector
* πŸ’„ inject_build_props.py imports are sorted
1 parent 88e6c12 commit e45783c

File tree

6 files changed

+106
-49
lines changed

6 files changed

+106
-49
lines changed

β€Ž.github/workflows/development.yml

+23-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Development
33
on:
44
pull_request:
55
branches:
6-
- '**'
6+
- "**"
77

88
jobs:
99
unit-tests:
@@ -28,9 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
strategy:
3030
matrix:
31-
python:
32-
- "3.12"
33-
- "3.8"
31+
python: ["3.12", "3.8"]
3432
steps:
3533
- uses: actions/checkout@v4
3634
- name: Set up Python
@@ -41,3 +39,24 @@ jobs:
4139
run: pip install tox
4240
- name: Run integration tests
4341
run: tox -e test-integration -- -m smoke
42+
43+
publish-dev:
44+
needs: [unit-tests, integration-tests]
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: "3.8"
52+
- name: Install pypa/build and pypa/twine
53+
run: python3 -m pip install build twine --user
54+
- name: Build a binary wheel & Inject build props
55+
run: python3 -m tox -e build
56+
- name: Publish to Internal PyPI
57+
env:
58+
GUIDELLM_BUILD_TYPE: dev
59+
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
60+
TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }}
61+
TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }}
62+
run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/*

β€Ž.github/workflows/nightly.yml

+34-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Nightly
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *' # Runs at midnight every night
5+
- cron: "0 0 * * *"
66

77
jobs:
88
unit-tests:
@@ -67,3 +67,36 @@ jobs:
6767
run: pip install tox
6868
- name: Run e2e tests
6969
run: tox -e test-e2e -- -m smoke
70+
71+
publish-nightly:
72+
needs: [unit-tests, integration-tests, e2e-tests]
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v4
76+
- name: Set up Python
77+
uses: actions/setup-python@v5
78+
with:
79+
python-version: "3.8"
80+
- name: Install pypa/build and pypa/twine
81+
run: python3 -m pip install build twine --user
82+
- name: Build a binary wheel & Inject build props
83+
run: python3 -m tox -e build
84+
- name: Publish to Internal PyPI
85+
env:
86+
GUIDELLM_BUILD_TYPE: nightly
87+
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
88+
TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }}
89+
TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }}
90+
run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/*
91+
92+
- name: Publish to Public PyPI
93+
if: success()
94+
env:
95+
env:
96+
GUIDELLM_BUILD_TYPE: nightly
97+
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
98+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
99+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
100+
run: |
101+
DATE=$(date +%Y%m%d)
102+
python -m twine upload dist/*

β€Ž.github/workflows/publish.yml

-40
This file was deleted.

β€Ž.github/workflows/quality.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
pull_request:
88
branches:
9-
- '**'
9+
- "**"
1010

1111
jobs:
1212
quality-check:

β€Ž.github/workflows/release.yml

+44
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,47 @@ jobs:
6868
run: pip install tox
6969
- name: Run e2e tests
7070
run: tox -e test-e2e -- --cov-report=term-missing --cov --cov-fail-under=75
71+
72+
publish-release-candidate:
73+
name: Publish Release Candidate
74+
needs: [unit-tests, integration-tests, e2e-tests]
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
- name: Set up Python
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: "3.8"
82+
- name: Install pypa/build and pypa/twine
83+
run: python3 -m pip install build twine --user
84+
- name: Build a binary wheel & Inject build props
85+
run: python3 -m tox -e build
86+
- name: Publish to Internal PyPI
87+
env:
88+
GUIDELLM_BUILD_TYPE: dev
89+
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
90+
TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }}
91+
TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }}
92+
run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/*
93+
94+
publish-final-release:
95+
name: Publish Final Release
96+
if: github.ref == 'refs/tags/v*'
97+
runs-on: ubuntu-latest
98+
steps:
99+
- uses: actions/checkout@v4
100+
- name: Set up Python
101+
uses: actions/setup-python@v5
102+
with:
103+
python-version: "3.8"
104+
- name: Install pypa/build and pypa/twine
105+
run: python3 -m pip install build twine --user
106+
- name: Build a binary wheel & Inject build props
107+
run: python3 -m tox build
108+
- name: Publish to Public PyPI
109+
env:
110+
GUIDELLM_BUILD_TYPE: release
111+
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
112+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
113+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
114+
run: python -m twine upload dist/*

β€Žutils/inject_build_props.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from loguru import logger
2-
import toml
31
import os
4-
from datetime import datetime
52
import re
3+
from datetime import datetime
4+
5+
import toml
6+
from loguru import logger
67

78

89
def get_build_type():

0 commit comments

Comments
Β (0)