Skip to content

Commit

Permalink
πŸ‘·β€β™‚οΈ Builds are updated according to a new infrastructure injector
Browse files Browse the repository at this point in the history
* πŸ’„ inject_build_props.py imports are sorted
  • Loading branch information
Dmytro Parfeniuk committed Jul 26, 2024
1 parent 88e6c12 commit e45783c
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 49 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Development
on:
pull_request:
branches:
- '**'
- "**"

jobs:
unit-tests:
Expand All @@ -28,9 +28,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.8"
python: ["3.12", "3.8"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -41,3 +39,24 @@ jobs:
run: pip install tox
- name: Run integration tests
run: tox -e test-integration -- -m smoke

publish-dev:
needs: [unit-tests, integration-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install pypa/build and pypa/twine
run: python3 -m pip install build twine --user
- name: Build a binary wheel & Inject build props
run: python3 -m tox -e build
- name: Publish to Internal PyPI
env:
GUIDELLM_BUILD_TYPE: dev
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }}
run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/*
35 changes: 34 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Nightly

on:
schedule:
- cron: '0 0 * * *' # Runs at midnight every night
- cron: "0 0 * * *"

jobs:
unit-tests:
Expand Down Expand Up @@ -67,3 +67,36 @@ jobs:
run: pip install tox
- name: Run e2e tests
run: tox -e test-e2e -- -m smoke

publish-nightly:
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install pypa/build and pypa/twine
run: python3 -m pip install build twine --user
- name: Build a binary wheel & Inject build props
run: python3 -m tox -e build
- name: Publish to Internal PyPI
env:
GUIDELLM_BUILD_TYPE: nightly
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }}
run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/*

- name: Publish to Public PyPI
if: success()
env:
env:
GUIDELLM_BUILD_TYPE: nightly
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
DATE=$(date +%Y%m%d)
python -m twine upload dist/*
40 changes: 0 additions & 40 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
branches:
- '**'
- "**"

jobs:
quality-check:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,47 @@ jobs:
run: pip install tox
- name: Run e2e tests
run: tox -e test-e2e -- --cov-report=term-missing --cov --cov-fail-under=75

publish-release-candidate:
name: Publish Release Candidate
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install pypa/build and pypa/twine
run: python3 -m pip install build twine --user
- name: Build a binary wheel & Inject build props
run: python3 -m tox -e build
- name: Publish to Internal PyPI
env:
GUIDELLM_BUILD_TYPE: dev
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
TWINE_USERNAME: ${{ secrets.INTERNAL_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.INTERNAL_PYPI_PASSWORD }}
run: python -m twine upload --repository-url ${{ secrets.INTERNAL_PYPI_REPOSITORY_URL }} dist/*

publish-final-release:
name: Publish Final Release
if: github.ref == 'refs/tags/v*'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install pypa/build and pypa/twine
run: python3 -m pip install build twine --user
- name: Build a binary wheel & Inject build props
run: python3 -m tox build
- name: Publish to Public PyPI
env:
GUIDELLM_BUILD_TYPE: release
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number }}
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: python -m twine upload dist/*
7 changes: 4 additions & 3 deletions utils/inject_build_props.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from loguru import logger
import toml
import os
from datetime import datetime
import re
from datetime import datetime

import toml
from loguru import logger


def get_build_type():
Expand Down

0 comments on commit e45783c

Please sign in to comment.