|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: |
6 | | - - master |
| 6 | + - "**" |
7 | 7 | tags: |
8 | 8 | - v* |
9 | 9 | pull_request: |
@@ -419,41 +419,61 @@ jobs: |
419 | 419 |
|
420 | 420 | build-and-deploy-docs: |
421 | 421 | runs-on: ubuntu-latest |
422 | | - needs: [check-python-style, build-python-wheels] |
| 422 | + needs: [check-python-style, build-python-wheels, build-python-wheels-rocm] |
423 | 423 |
|
| 424 | + permissions: |
| 425 | + contents: write |
424 | 426 | steps: |
425 | 427 | - uses: actions/checkout@v4 |
426 | | - |
427 | 428 | - name: Set up Python 3.10.11 |
428 | 429 | uses: actions/setup-python@v5 |
429 | 430 | with: |
430 | 431 | python-version: "3.10.11" |
431 | | - |
432 | 432 | - name: Download CTranslate2 wheels |
433 | 433 | uses: actions/download-artifact@v4 |
434 | 434 | with: |
435 | 435 | pattern: python-wheels-${{ runner.os }}-* |
436 | 436 | merge-multiple: true |
437 | 437 | path: . |
438 | | - |
439 | 438 | - name: Install CTranslate2 wheel |
440 | 439 | run: | |
441 | 440 | pip install *cp310*manylinux*x86_64.whl |
442 | | -
|
443 | 441 | - name: Install dependencies to build docs |
444 | 442 | working-directory: docs |
445 | 443 | run: | |
446 | 444 | python -m pip install -r requirements.txt |
447 | | -
|
448 | 445 | - name: Build docs |
449 | 446 | working-directory: docs |
450 | 447 | run: | |
451 | 448 | python generate.py python |
452 | 449 | sphinx-build . build |
453 | | -
|
454 | 450 | - name: Deploy docs |
455 | 451 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') |
456 | 452 | uses: JamesIves/github-pages-deploy-action@v4 |
457 | 453 | with: |
458 | 454 | folder: docs/build |
459 | 455 | clean: true |
| 456 | + - name: Download ROCm wheels and zip for release |
| 457 | + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') |
| 458 | + env: |
| 459 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 460 | + run: | |
| 461 | + mkdir -p release-zips |
| 462 | +
|
| 463 | + gh run download ${{ github.run_id }} \ |
| 464 | + --name rocm-python-wheels-Linux \ |
| 465 | + --dir temp-linux |
| 466 | + zip -r release-zips/rocm-python-wheels-Linux.zip temp-linux/* |
| 467 | + rm -rf temp-linux |
| 468 | +
|
| 469 | + gh run download ${{ github.run_id }} \ |
| 470 | + --name rocm-python-wheels-Windows \ |
| 471 | + --dir temp-windows |
| 472 | + zip -r release-zips/rocm-python-wheels-Windows.zip temp-windows/* |
| 473 | + rm -rf temp-windows |
| 474 | +
|
| 475 | + - name: Create GitHub Release |
| 476 | + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') |
| 477 | + uses: softprops/action-gh-release@v2 |
| 478 | + with: |
| 479 | + files: release-zips/*.zip |
0 commit comments