Update OpenCV #11
This file contains 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: OpenCV dependency | |
on: | |
schedule: | |
- cron: '0 7 * * *' | |
jobs: | |
depend-opencv: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fetch release version | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
OWNER: opencv | |
REPO: opencv | |
run: | | |
VERSION=$(gh api "/repos/$OWNER/$REPO/releases/latest" \ | |
--jq ".tag_name") | |
echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
CURRENT=$(grep 'OPENCV_TINY_VERSION:' .github/workflows/ci.yml | awk '{print $2}') | |
echo "CURRENT=$CURRENT" >> "$GITHUB_ENV" | |
- name: Modify files if new version | |
if: ${{ env.VERSION != env.CURRENT }} | |
run: | | |
sed -E -i "s@(OPENCV_TINY_VERSION:\s+\")([0-9]+\.[0-9]+\.[0-9]+)(\")@\1$VERSION\3@" .github/workflows/{ci,arm}.yml | |
sed -E -i "s@(curl https://raw.githubusercontent.com/EmixamPP/opencv-tiny/main/build.sh | bash -s )[0-9]+\.[0-9]+\.[0-9]+(.*)@\1$VERSION\2@" README.md | |
- name: Create PR if new version | |
if: ${{ env.VERSION != env.CURRENT }} | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.PAT }} | |
title: "chore(deps): update opencv version" | |
branch: "opencv-${{ env.VERSION }}" | |
commit-message: "chore(deps): update opencv version" | |
body: | | |
Update OpenCV to ${{ env.VERSION }}. | |
This PR has been created automatically. | |
assignees: "EmixamPP" | |
reviewers: "EmixamPP" | |
delete-branch: true | |