-
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (70 loc) · 2.89 KB
/
nightly.yml
File metadata and controls
72 lines (70 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: oracle
java-version: 25
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- 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=$(sed -nE 's/^version=([\.0-9]+)-[0-9]-SNAPSHOT$/\1/p' gradle.properties)
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
sed -i -E "/version=/ s/=.*/=${NEW_VERSION}-1-SNAPSHOT/" gradle.properties
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