script: Move drop logic for several WebGPU types to helper structs (#… #4
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: Book Export | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| upstream: | |
| # Run job only on servo/servo | |
| if: github.repository == 'servo/servo' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Servo | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: | | |
| python/servo/platform/linux_packages | |
| fetch-depth: '2' | |
| - name: Check out Servo book | |
| uses: actions/checkout@v6 | |
| with: | |
| path: book | |
| repository: 'servo/book' | |
| token: ${{ secrets.BOOK_SYNC_TOKEN }} | |
| - name: Check for changes | |
| working-directory: python/servo/platform/linux_packages | |
| id: changes | |
| run: | | |
| # Note: This check assumes the action only runs on `main`. | |
| if git diff --quiet HEAD HEAD^ -- . ; then | |
| echo "No changes detected, exiting." | |
| echo "CHANGES=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "Changes detected, exporting book." | |
| ./generate_pkg_list.sh apt/apt_common.txt > ${{github.workspace}}/book/src/building/linux_packages/apt_common.txt | |
| ./generate_pkg_list.sh apt/apt_ubuntu_only.txt > ${{github.workspace}}/book/src/building/linux_packages/apt_ubuntu_only.txt | |
| ./generate_pkg_list.sh dnf/dnf_base.txt > ${{github.workspace}}/book/src/building/linux_packages/dnf_base.txt | |
| ./generate_pkg_list.sh xbps/xbps_base.txt > ${{github.workspace}}/book/src/building/linux_packages/xbps_base.txt | |
| echo "CHANGES=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit changes | |
| working-directory: book | |
| if: ${{ steps.changes.outputs.CHANGES == 'true'}} | |
| run: | | |
| git config --local user.email "ghbot+book-sync@servo.org" | |
| git config --local user.name "Book Sync Bot" | |
| git add src/building/linux_packages/ | |
| git commit -m "linux: Update dependency list based on servo/servo@${GITHUB_SHA::13}" | |
| - name: Push changes | |
| if: ${{ steps.changes.outputs.CHANGES == 'true'}} | |
| working-directory: book | |
| run: git push 'https://${{ secrets.BOOK_SYNC_TOKEN }}@github.com/servo-bot/book.git' 'HEAD:linux_pkgs_sync_${{ github.sha }}' | |
| - name: Open PR | |
| if: ${{ steps.changes.outputs.CHANGES == 'true'}} | |
| env: | |
| GH_TOKEN: ${{ secrets.BOOK_SYNC_CREATE_PR_TOKEN }} | |
| UPDATE_BRANCH: linux_pkgs_sync_${{ github.sha }} | |
| working-directory: book | |
| run: | | |
| BODY=$(cat <<EOF | |
| Update dependency list based on servo/servo@${GITHUB_SHA} | |
| EOF | |
| ) | |
| gh pr create \ | |
| --title "Sync Linux packages with servo (${GITHUB_SHA::7})" \ | |
| --repo servo/book \ | |
| --body "$BODY" --head servo-bot:${{ env.UPDATE_BRANCH }} |