Skip to content

Update

Update #89

Workflow file for this run

name: Update
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * MON"
jobs:
update:
name: Update
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.ONNXRUNTIME_BUILD_DEPLOY_KEY_FULL_ACCESS }}
- name: Get ONNX Runtime versions
run: |
CURRENT_ONNXRUNTIME_VERSION=$(cat ONNXRUNTIME_VERSION)
echo CURRENT_ONNXRUNTIME_VERSION=$CURRENT_ONNXRUNTIME_VERSION >> $GITHUB_ENV
echo "Current ONNX Runtime Version : $CURRENT_ONNXRUNTIME_VERSION"
LATEST_ONNXRUNTIME_VERSION=$(curl -sL https://api.github.com/repos/microsoft/onnxruntime/releases/latest | jq -r '.tag_name' | sed 's/^v//')
echo LATEST_ONNXRUNTIME_VERSION=$LATEST_ONNXRUNTIME_VERSION >> $GITHUB_ENV
echo "Latest ONNX Runtime Version : $LATEST_ONNXRUNTIME_VERSION"
- name: Update ONNX Runtime
if: env.LATEST_ONNXRUNTIME_VERSION != env.CURRENT_ONNXRUNTIME_VERSION
run: |
echo $LATEST_ONNXRUNTIME_VERSION > ONNXRUNTIME_VERSION
git submodule update --init --depth=1 onnxruntime
cd onnxruntime
git fetch origin tag v$LATEST_ONNXRUNTIME_VERSION
git checkout v$LATEST_ONNXRUNTIME_VERSION
- name: Commit & push
if: env.LATEST_ONNXRUNTIME_VERSION != env.CURRENT_ONNXRUNTIME_VERSION
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am v$LATEST_ONNXRUNTIME_VERSION
git tag v$LATEST_ONNXRUNTIME_VERSION
git push origin : v$LATEST_ONNXRUNTIME_VERSION