Repository navigation
Bump prek from 0.5.10 to 0.5.11 #333
Workflow file for this run
This file contains hidden or 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: build | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| jobs: | |
| build_python: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| whl-name: ${{ steps.asset-list.outputs.whl_name }} | |
| whl-artifact-id: ${{ steps.artifact-whl-upload-step.outputs.artifact-id }} | |
| pex-artifact-id: ${{ steps.artifact-pex-upload-step.outputs.artifact-id }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v10.3.2 | |
| with: | |
| enable-cache: true | |
| ignore-nothing-to-cache: true | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Build wheel and pex | |
| run: | | |
| make clean | |
| make build-whl dist/treefort.pex | |
| - name: Read the python asset list | |
| id: asset-list | |
| run: | | |
| set -eo pipefail | |
| echo "whl_name=$(find dist/ -name '*.whl' -exec basename {} \+)" >> "$GITHUB_OUTPUT" | |
| - uses: actions/upload-artifact@v7 | |
| id: artifact-whl-upload-step | |
| if: github.event_name == 'pull_request' | |
| with: | |
| name: ${{ steps.asset-list.outputs.whl_name }} | |
| path: dist/*.whl | |
| - uses: actions/upload-artifact@v7 | |
| id: artifact-pex-upload-step | |
| if: github.event_name == 'pull_request' | |
| with: | |
| name: treefort.pex | |
| path: dist/treefort.pex | |
| build_binary_amd64: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| exe-artifact-id: ${{ steps.artifact-exe-upload-step.outputs.artifact-id }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v10.3.2 | |
| with: | |
| enable-cache: true | |
| ignore-nothing-to-cache: true | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Build binary | |
| run: | | |
| make clean | |
| make dist/treefort | |
| mv dist/treefort dist/treefort-linux-amd64 | |
| - uses: actions/upload-artifact@v7 | |
| id: artifact-exe-upload-step | |
| if: github.event_name == 'pull_request' | |
| with: | |
| name: treefort-linux-amd64 | |
| path: dist/treefort-linux-amd64 | |
| build_binary_arm64: | |
| runs-on: ubuntu-24.04-arm | |
| outputs: | |
| exe-artifact-id: ${{ steps.artifact-exe-upload-step.outputs.artifact-id }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v10.3.2 | |
| with: | |
| enable-cache: true | |
| ignore-nothing-to-cache: true | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Build binary | |
| run: | | |
| make clean | |
| make dist/treefort | |
| mv dist/treefort dist/treefort-linux-arm64 | |
| - uses: actions/upload-artifact@v7 | |
| id: artifact-exe-upload-step | |
| if: github.event_name == 'pull_request' | |
| with: | |
| name: treefort-linux-arm64 | |
| path: dist/treefort-linux-arm64 | |
| comment-pr: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| needs: | |
| - build_python | |
| - build_binary_amd64 | |
| - build_binary_arm64 | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| artifact-ids: ${{ needs.build_python.outputs.pex-artifact-id }},${{ needs.build_python.outputs.whl-artifact-id }},${{ needs.build_binary_amd64.outputs.exe-artifact-id }},${{ needs.build_binary_arm64.outputs.exe-artifact-id }} | |
| - name: Read the asset list | |
| id: asset-list | |
| run: | | |
| set -eo pipefail | |
| WHL_NAME="$(find ./ -name '*whl' -type f | head -1 | xargs basename)" | |
| WHL_CHECKSUM="$(find ./ -name '*whl' -type f | head -1 | xargs sha256sum | cut -d ' ' -f 1)" | |
| PEX_CHECKSUM="$(find ./ -name 'treefort.pex' -type f | head -1 | xargs sha256sum | cut -d ' ' -f 1)" | |
| EXE_AMD64_CHECKSUM="$(find ./ -name 'treefort-linux-amd64' -type f | head -1 | xargs sha256sum | cut -d ' ' -f 1)" | |
| EXE_ARM64_CHECKSUM="$(find ./ -name 'treefort-linux-arm64' -type f | head -1 | xargs sha256sum | cut -d ' ' -f 1)" | |
| { | |
| echo "WHL_NAME=${WHL_NAME}" | |
| echo "WHL_CHECKSUM=${WHL_CHECKSUM}" | |
| echo "PEX_CHECKSUM=${PEX_CHECKSUM}" | |
| echo "EXE_AMD64_CHECKSUM=${EXE_AMD64_CHECKSUM}" | |
| echo "EXE_ARM64_CHECKSUM=${EXE_ARM64_CHECKSUM}" | |
| } >> "$GITHUB_ENV" | |
| - name: Create PR comment with asset link | |
| uses: thollander/actions-comment-pull-request@v3 | |
| with: | |
| message: | | |
| 🎉 **Build Assets are ready!** | |
| | Type | File | Checksum | | |
| | --- | --- | --- | | |
| | Wheel | [${{ env.WHL_NAME }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ needs.build_python.outputs.whl-artifact-id }}) | `${{ env.WHL_CHECKSUM }}` | | |
| | PEX | [treefort.pex](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ needs.build_python.outputs.pex-artifact-id }}) | `${{ env.PEX_CHECKSUM }}` | | |
| | Binary (amd64) | [treefort-linux-amd64](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ needs.build_binary_amd64.outputs.exe-artifact-id }}) | `${{ env.EXE_AMD64_CHECKSUM }}` | | |
| | Binary (arm64) | [treefort-linux-arm64](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ needs.build_binary_arm64.outputs.exe-artifact-id }}) | `${{ env.EXE_ARM64_CHECKSUM }}` | | |
| comment-tag: build-assets |