cleaner sync #1
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: Update Kernel Branches | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| update-branches: | |
| runs-on: ubuntu-latest | |
| # Only run on the original repository, not forks automatically | |
| if: github.repository == 'jupyter-java/jupyter-java-binder' | |
| strategy: | |
| matrix: | |
| kernel: [jbang, jjava, rapaio, kotlin, ijava] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Update ${{ matrix.kernel }} branch | |
| run: | | |
| git checkout ${{ matrix.kernel }} 2>/dev/null || git checkout -b ${{ matrix.kernel }} | |
| # Replace install kernels section with kernel-specific installation | |
| sed -i '/^## install kernels$/,/^## end install kernels$/c\ | |
| ## install kernels\ | |
| jbang install-kernel@jupyter-java --java $JAVA_VERSION ${{ matrix.kernel }}\ | |
| ## end install kernels' postBuild | |
| git add postBuild | |
| git commit -m "Update ${{ matrix.kernel }} kernel installation" || echo "No changes to commit" | |
| git push origin ${{ matrix.kernel }} |