test version release #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Release Workflow on Release Branch | |
on: | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- release # Change from main to release for testing | |
jobs: | |
validate-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Validate Tag Format | |
run: | | |
TAG_REGEX='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\-\.]+)?$' | |
echo "Regex to match: $TAG_REGEX" | |
TAG="${GITHUB_REF/refs\/tags\//}" | |
echo "Tag extracted: $TAG" | |
if [[ "$TAG" =~ $TAG_REGEX ]]; then | |
echo "Tag format is valid." | |
else | |
echo "::error::Tag $TAG does not match the 'vMAJOR.MINOR.PATCH' or 'vMAJOR.MINOR.PATCH-pre-release' format." | |
exit 1 | |
fi | |
shell: bash | |
build-and-package: | |
needs: validate-tag | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] # Using the same Python versions as in your test workflow | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Install dependencies | |
run: | | |
cd lightrag | |
poetry config virtualenvs.create false | |
poetry install | |
# - name: Run tests with pytest | |
# run: | | |
# cd lightrag | |
# poetry run pytest | |
- name: Build the distribution | |
run: | | |
cd lightrag | |
poetry build | |
dry-run-publish: | |
needs: build-and-package | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] # Ensure consistency with build-and-package job | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Dry run publish to PyPI | |
run: | | |
cd lightrag | |
poetry publish --dry-run --build | |
# This step simulates the publishing process without making actual changes |