Nightly Checks #35
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: Nightly Checks | |
| on: | |
| schedule: | |
| - cron: '23 4 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| nightly: | |
| runs-on: ubuntu-latest | |
| name: Nightly Checks | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: gradle/actions/wrapper-validation@v5 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: oracle | |
| java-version: 25 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Get recent commits | |
| id: recent_commits | |
| run: echo "count=$(git log --oneline --since '24 hours ago' | wc -l)" >> "$GITHUB_OUTPUT" | |
| - name: Publish snapshot | |
| if: ${{ steps.recent_commits.outputs.count > 0 }} | |
| env: | |
| ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.PGP_KEY_ID }} | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_KEY }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSWORD }} | |
| ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} | |
| ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} | |
| run: | | |
| ./gradlew --no-daemon -s publishOnnxruntimePublicationToSonatypeRepository | |
| - name: Check upstream project for upgrades | |
| id: update_check | |
| run: | | |
| OLD_VERSION=$(cat ORT_VERSION) | |
| NEW_VERSION=$(curl -s https://api.github.com/repos/microsoft/onnxruntime/tags | jq -r ".[0].name" | sed 's/^v//g') | |
| echo "old: $OLD_VERSION" | |
| echo "new: $NEW_VERSION" | |
| if [ "$OLD_VERSION" = "$NEW_VERSION" ]; then | |
| echo "::notice::up to date with upstream" | |
| exit 0 | |
| fi | |
| echo $NEW_VERSION > ORT_VERSION | |
| pushd /tmp | |
| curl -o jextract.tar.gz -L https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_linux-x64_bin.tar.gz | |
| tar xvzf jextract.tar.gz | |
| rm jextract.tar.gz | |
| mv jextract-* jextract | |
| popd | |
| PATH=/tmp/jextract/bin:$PATH ./gradlew --no-daemon -s jextract | |
| echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v8 | |
| if: ${{ steps.update_check.outputs.new_version }} | |
| with: | |
| token: ${{ secrets.GHA_PR_TOKEN }} | |
| branch: ort/${{ steps.update_check.outputs.new_version }} | |
| delete-branch: true | |
| commit-message: "ORT v${{ steps.update_check.outputs.new_version }} bump" | |
| title: 'Set onnxruntime baseline to v${{ steps.update_check.outputs.new_version }}' | |
| body: | | |
| This is an automated PR to bump to version ${{ steps.update_check.outputs.new_version }} of the upstream project. | |
| labels: | | |
| upstream_upgrade |