Skip to content

graphrag-byokg/v3.18.0.dev0 #6

graphrag-byokg/v3.18.0.dev0

graphrag-byokg/v3.18.0.dev0 #6

# This workflow creates a pre-release build without uploading artifacts to PyPI.
name: BYOKG-RAG Pre-Release
on:
release:
types: [prereleased]
permissions:
contents: write
attestations: write
id-token: write
jobs:
pre-release-build:
# Constraint: Only run if the tag starts with 'graphrag-byokg-rag/v':
if: startsWith(github.ref, 'refs/tags/graphrag-byokg/v')
runs-on: ubuntu-latest
defaults:
run:
working-directory: byokg-rag
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
- name: Create virtual environment
run: uv venv .venv
- name: Install build dependencies
run: uv pip install --python .venv/bin/python build
- name: Build package
run: .venv/bin/python -m build
- name: Create latest dist copies
run: |
cp dist/*.whl dist/byokg-rag-latest.whl
cp dist/*.tar.gz dist/byokg-rag-latest.tar.gz
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: byokg-rag-dist
path: byokg-rag/dist/
- name: Extract version
id: version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
VERSION="${GITHUB_REF_NAME#graphrag-byokg/}"
else
VERSION="v$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')"
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Zip byokg-rag source
run: |
zip -r dist/byokg-rag-${{ steps.version.outputs.version }}.zip \
src/ pyproject.toml README.md
cp dist/byokg-rag-${{ steps.version.outputs.version }}.zip dist/byokg-rag-latest.zip
- name: Upload byokg-rag zip artifact
uses: actions/upload-artifact@v7
with:
name: byokg-rag-zip
path: |
byokg-rag/dist/byokg-rag-${{ steps.version.outputs.version }}.zip
byokg-rag/dist/byokg-rag-latest.zip
retention-days: 30
- name: Zip byokg-rag notebooks
working-directory: examples/byokg-rag
run: |
zip byokg-notebooks.zip *.ipynb
cp byokg-notebooks.zip byokg-notebooks-${{ steps.version.outputs.version }}.zip
cp byokg-notebooks.zip byokg-notebooks-latest.zip
- name: Upload byokg-notebooks zip artifact
uses: actions/upload-artifact@v7
with:
name: byokg-notebooks
path: |
examples/byokg-rag/byokg-notebooks.zip
examples/byokg-rag/byokg-notebooks-${{ steps.version.outputs.version }}.zip
examples/byokg-rag/byokg-notebooks-latest.zip
retention-days: 30
- name: Generate checksums
working-directory: ${{ github.workspace }}
run: |
cd byokg-rag/dist && sha256sum *.whl *.tar.gz > SHA256SUMS && cd ${{ github.workspace }}
sha256sum examples/byokg-rag/byokg-notebooks-${{ steps.version.outputs.version }}.zip | sed 's|.*/||' >> byokg-rag/dist/SHA256SUMS
- name: Attest build provenance
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
with:
subject-path: |
byokg-rag/dist/*.whl
byokg-rag/dist/*.tar.gz
byokg-rag/dist/SHA256SUMS
examples/byokg-rag/byokg-notebooks-${{ steps.version.outputs.version }}.zip
- name: Attach artifacts to GitHub Pre-Release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3
with:
files: |
byokg-rag/dist/*
examples/byokg-rag/byokg-notebooks-${{ steps.version.outputs.version }}.zip
examples/byokg-rag/byokg-notebooks-latest.zip
prerelease: true