ci: fix artifact unpacking #338
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: doc | |
on: | |
push: | |
branches-ignore: [release] | |
paths: | |
- "doc/**" | |
- "src/**" | |
- "tox.ini" | |
- ".github/workflows/doc.yml" | |
pull_request: | |
branches: [main] | |
paths: | |
- "doc/**" | |
- "src/**" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set pkgcraft dir env var | |
run: echo pkgcraft_dir=~/pkgcraft >> $GITHUB_ENV | |
- name: Download pkgcraft-c library from most recent run | |
if: ${{ inputs.event-type == '' }} | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
github_token: ${{ secrets.PKGCRAFT_CI_TOKEN }} | |
repo: pkgcraft/pkgcraft | |
branch: main | |
workflow: pkgcraft-c.yml | |
workflow_conclusion: "" | |
search_artifacts: true | |
name: pkgcraft-c-${{ runner.os }} | |
- name: Unpack library | |
run: | | |
mkdir -p "${pkgcraft_dir}" | |
tar -Jxf pkgcraft-c.tar.xz -C "${pkgcraft_dir}" | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: 'pip' | |
cache-dependency-path: 'pyproject.toml' | |
- name: Install dependencies | |
run: pip install tox | |
- name: Override build variables | |
run: | | |
echo "PKG_CONFIG_PATH=${pkgcraft_dir}" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=${pkgcraft_dir}" >> $GITHUB_ENV | |
echo "DYLD_LIBRARY_PATH=${pkgcraft_dir}" >> $GITHUB_ENV | |
- name: Build documentation | |
run: | | |
tox -e doc | |
# notify github this isn't a jekyll site | |
touch doc/_build/html/.nojekyll | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: doc/_build/html | |
deploy: | |
if: ${{ github.ref_name == 'main' }} | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |