@@ -620,9 +620,37 @@ jobs:
620620 files : target/site/jacoco/jacoco.xml
621621 continue-on-error : true
622622
623+ github-snapshot :
624+ name : Update Snapshot Pre-release on GitHub
625+ needs : [report]
626+ if : >-
627+ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
628+ github.event_name == 'workflow_dispatch'
629+ runs-on : ubuntu-latest
630+ permissions :
631+ contents : write
632+ steps :
633+ - uses : actions/download-artifact@v8
634+ with :
635+ name : llama-jars
636+ path : snapshot-assets/
637+ - name : Update snapshot pre-release
638+ env :
639+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
640+ run : |
641+ gh release view snapshot --repo ${{ github.repository }} 2>/dev/null \
642+ || gh release create snapshot \
643+ --repo ${{ github.repository }} \
644+ --prerelease \
645+ --title "Snapshot (latest)" \
646+ --notes "Latest snapshot build from the main branch."
647+ gh release upload snapshot snapshot-assets/* \
648+ --repo ${{ github.repository }} \
649+ --clobber
650+
623651 publish-snapshot :
624652 name : Publish Snapshot to Central
625- needs : [report ]
653+ needs : [github-snapshot ]
626654 if : >-
627655 (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
628656 github.event_name == 'workflow_dispatch'
@@ -655,10 +683,27 @@ jobs:
655683 MAVEN_USERNAME : ${{ secrets.CENTRAL_USERNAME }}
656684 MAVEN_PASSWORD : ${{ secrets.CENTRAL_TOKEN }}
657685
686+ github-release :
687+ name : Attach Binaries to GitHub Release
688+ needs : [report]
689+ if : startsWith(github.ref, 'refs/tags/v')
690+ runs-on : ubuntu-latest
691+ permissions :
692+ contents : write
693+ steps :
694+ - uses : actions/download-artifact@v8
695+ with :
696+ name : llama-jars
697+ path : release-assets/
698+ - name : Upload release assets
699+ uses : softprops/action-gh-release@v2
700+ with :
701+ files : release-assets/*
702+
658703 publish-release :
659704 name : Publish Release to Central
660705 if : startsWith(github.ref, 'refs/tags/v') || github.event.inputs.release_to_maven_central == 'true'
661- needs : [report , crosscompile-linux-x86_64-cuda]
706+ needs : [github-release , crosscompile-linux-x86_64-cuda]
662707 runs-on : ubuntu-latest
663708 environment : maven-central
664709 steps :
@@ -689,20 +734,3 @@ jobs:
689734 MAVEN_USERNAME : ${{ secrets.CENTRAL_USERNAME }}
690735 MAVEN_PASSWORD : ${{ secrets.CENTRAL_TOKEN }}
691736 MAVEN_GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
692-
693- github-release :
694- name : Attach Binaries to GitHub Release
695- needs : [publish-release]
696- if : startsWith(github.ref, 'refs/tags/v')
697- runs-on : ubuntu-latest
698- permissions :
699- contents : write
700- steps :
701- - uses : actions/download-artifact@v8
702- with :
703- name : llama-jars
704- path : release-assets/
705- - name : Upload release assets
706- uses : softprops/action-gh-release@v2
707- with :
708- files : release-assets/*
0 commit comments