Skip to content

Commit

Permalink
workflows/{docs,release}: test transition to hatch/uv
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix committed Feb 23, 2024
1 parent bc379eb commit eaac906
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 43 deletions.
47 changes: 25 additions & 22 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,34 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.7.1'
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: "poetry"
- name: Check Poetry lock file consistency
run: poetry check --lock
python-version: 3.12
cache: "pip"
- name: Install uv
run: |
# https://github.com/astral-sh/uv/issues/1386#issuecomment-1947801083
echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
pip install uv
- name: Install dependencies
run: poetry install --sync
run: |
# FIXME: https://github.com/Qiskit/qiskit_sphinx_theme/issues/567
echo 'furo==2023.9.10' > furo-override.txt
uv pip compile pyproject.toml --all-extras --override furo-override.txt > requirements.txt
uv pip sync --strict requirements.txt
uv pip install --editable .
- name: Check version numbers consistency
run: poetry run poe version_check
run: poe version_check
- name: Build documentation
run: poetry run poe docs
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/_build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
run: poe docs
# - name: Setup Pages
# uses: actions/configure-pages@v4
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v3
# with:
# path: 'docs/_build'
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4
43 changes: 23 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,44 @@ on:
push:
tags:
- 'v*'
# Run on manual triggers
workflow_dispatch:
jobs:
wheel-build:
release:
name: Build and Publish Release Artifacts
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: write
# environment: release
# permissions:
# id-token: write
# contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.7.1'
python-version: 3.12
- name: Install uv
run: |
# https://github.com/astral-sh/uv/issues/1386#issuecomment-1947801083
echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
pip install uv
- name: Install release dependencies
run: pip install -U typer mistletoe
run: |
uv pip install typer mistletoe hatch
- name: Build packages
run: |
poetry build
shell: bash
hatch build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: ./dist/qiskit*
- name: Extract changelog
run: python scripts/extract-changelog.py ${{ github.ref_name }} | tee ${{ github.workspace }}-CHANGELOG.txt
- name: Create Github release
uses: softprops/action-gh-release@v1
with:
files: ./dist/qiskit*
body_path: ${{ github.workspace }}-CHANGELOG.txt
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# - name: Create Github release
# uses: softprops/action-gh-release@v1
# with:
# files: ./dist/qiskit*
# body_path: ${{ github.workspace }}-CHANGELOG.txt
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ jobs:
- name: Lock dependencies
run: |
echo "qiskit==${{ matrix.qiskit-version }}" > qiskit-override.txt
echo 'furo==2023.9.10' > furo-override.txt # https://github.com/Qiskit/qiskit_sphinx_theme/issues/567
# FIXME: https://github.com/Qiskit/qiskit_sphinx_theme/issues/567
echo 'furo==2023.9.10' > furo-override.txt
uv pip compile pyproject.toml --all-extras --override qiskit-override.txt --override furo-override.txt > requirements.txt
- name: Install project
run: |
Expand Down

0 comments on commit eaac906

Please sign in to comment.