|
| 1 | +# Build and Release XPU Wheels |
| 2 | + |
| 3 | +name: Build and Release XPU Wheels |
| 4 | + |
| 5 | +on: |
| 6 | + release: |
| 7 | + types: [created] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + # Build the XPU wheels using the reusable building workflow |
| 15 | + build_xpu_wheels: |
| 16 | + name: Call reusable XPU building workflow |
| 17 | + uses: ./.github/workflows/building_xpu.yml |
| 18 | + |
| 19 | + create_release_and_upload_packages: |
| 20 | + name: Upload XPU Wheels to GitHub Release |
| 21 | + needs: [build_xpu_wheels] |
| 22 | + runs-on: ubuntu-latest |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] |
| 27 | + steps: |
| 28 | + - name: Checkout code |
| 29 | + uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + submodules: recursive |
| 32 | + |
| 33 | + - name: Download packages |
| 34 | + id: download_artifacts |
| 35 | + uses: actions/download-artifact@v4 |
| 36 | + with: |
| 37 | + # The unique artifact names from building_xpu.yml all start with |
| 38 | + # "xpu_wheels_python${{ matrix.python-version }}" so this pattern |
| 39 | + # will match them all and merge them into the 'dist' directory. |
| 40 | + pattern: xpu_wheels_python${{ matrix.python-version }}* |
| 41 | + path: dist |
| 42 | + merge-multiple: true |
| 43 | + |
| 44 | + - name: Upload packages to latest GitHub Release |
| 45 | + env: |
| 46 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + run: | |
| 48 | + echo "Fetching latest release info..." |
| 49 | + release_info=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ |
| 50 | + https://api.github.com/repos/isl-org/gsplat/releases/latest) |
| 51 | +
|
| 52 | + # Extract the "upload_url" field and strip the {?name,label} part |
| 53 | + upload_url=$(echo "$release_info" | grep '"upload_url":' | cut -d '"' -f 4 | sed 's/{.*//') |
| 54 | + echo "Upload URL: $upload_url" |
| 55 | +
|
| 56 | + for file in ./dist/*.*; do |
| 57 | + echo "Uploading $file..." |
| 58 | + filename=$(basename "$file") |
| 59 | + encoded_filename=$(echo "$filename" | sed 's/+/%2B/g') |
| 60 | + curl -X POST \ |
| 61 | + -H "Authorization: token $GITHUB_TOKEN" \ |
| 62 | + -H "Content-Type: application/octet-stream" \ |
| 63 | + --data-binary @"$file" \ |
| 64 | + "$upload_url?name=$encoded_filename" |
| 65 | + done |
| 66 | + echo "Upload complete." |
| 67 | +
|
| 68 | + generate_simple_index_pages: |
| 69 | + name: Generate Simple Index Pages |
| 70 | + needs: [create_release_and_upload_packages] |
| 71 | + runs-on: ubuntu-latest |
| 72 | + steps: |
| 73 | + - name: Checkout code |
| 74 | + uses: actions/checkout@v4 |
| 75 | + |
| 76 | + - name: Generate Simple Index Pages |
| 77 | + run: python .github/workflows/generate_simple_index_pages.py --outdir ./whl |
| 78 | + env: |
| 79 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 80 | + |
| 81 | + - name: Deploy to GitHub Pages |
| 82 | + uses: peaceiris/actions-gh-pages@v3 |
| 83 | + with: |
| 84 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + publish_dir: ./whl |
| 86 | + destination_dir: whl |
| 87 | + keep_files: false |
| 88 | + cname: docs.gsplat.studio |
0 commit comments