Skip to content

Commit

Permalink
chore(ci): Build with pyproject-build
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Dec 11, 2024
1 parent e1d1a0b commit cf20f99
Showing 1 changed file with 67 additions and 9 deletions.
76 changes: 67 additions & 9 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,73 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@v2
## Stuck on https://github.com/astral-sh/uv/issues/5450
## or https://github.com/hynek/build-and-inspect-python-package/issues/155
# - uses: hynek/build-and-inspect-python-package@v2
# with:
# upload-name-suffix: -main
# attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
# - uses: hynek/build-and-inspect-python-package@v2
# with:
# path: wrapper
# upload-name-suffix: -wrapper
# attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
## Manually reproducing with pyproject-build
## Probably slightly slower
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
- name: Build smriprep
run: uvx --from=build pyproject-build --installer uv .
- name: Upload smriprep as Packages-main
uses: actions/upload-artifact@v4
with:
upload-name-suffix: -main
attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
- uses: hynek/build-and-inspect-python-package@v2
name: Packages-main
path: dist/

- name: Show package contents hierarchically, including metadata.
shell: bash
run: |
echo -e '\n<details><summary>SDist contents</summary>\n' >> $GITHUB_STEP_SUMMARY
tar -tvzf dist/*.tar.gz | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY
echo -e '\n</details>\n' >> $GITHUB_STEP_SUMMARY
echo -e '\n<details><summary>Wheel contents</summary>\n' >> $GITHUB_STEP_SUMMARY
unzip -l dist/*.whl | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY
echo -e '\n</details>\n' >> $GITHUB_STEP_SUMMARY
echo ----- Metadata Follows -----
echo -e '\n<details><summary>Metadata</summary>\n' >> $GITHUB_STEP_SUMMARY
tar --wildcards -xOf dist/*.tar.gz "*/PKG-INFO" | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY
echo -e '\n</details>\n' >> $GITHUB_STEP_SUMMARY
echo ----- End of Metadata -----
- name: Report on smriprep packages
run: |
echo "name=Packages-main" >>${GITHUB_OUTPUT}
- name: Build smriprep-docker
run: uvx --from=build pyproject-build --installer uv ./wrapper
- name: Upload smriprep as Packages-wrapper
uses: actions/upload-artifact@v4
with:
path: wrapper
upload-name-suffix: -wrapper
attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
name: Packages-wrapper
path: dist/

- name: Show package contents hierarchically, including metadata.
shell: bash
run: |
echo -e '\n<details><summary>SDist contents</summary>\n' >> $GITHUB_STEP_SUMMARY
tar -tvzf wrapper/dist/*.tar.gz | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY
echo -e '\n</details>\n' >> $GITHUB_STEP_SUMMARY
echo -e '\n<details><summary>Wheel contents</summary>\n' >> $GITHUB_STEP_SUMMARY
unzip -l wrapper/dist/*.whl | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY
echo -e '\n</details>\n' >> $GITHUB_STEP_SUMMARY
echo ----- Metadata Follows -----
echo -e '\n<details><summary>Metadata</summary>\n' >> $GITHUB_STEP_SUMMARY
tar --wildcards -xOf wrapper/dist/*.tar.gz "*/PKG-INFO" | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY
echo -e '\n</details>\n' >> $GITHUB_STEP_SUMMARY
echo ----- End of Metadata -----
test:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -83,7 +141,7 @@ jobs:
with:
persist-credentials: false
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -139,7 +197,7 @@ jobs:
- run: ls -lR

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down

0 comments on commit cf20f99

Please sign in to comment.