Skip to content

Commit

Permalink
updated the trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixstars-momoko committed Dec 16, 2024
1 parent a152e17 commit 404cd28
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/build-opencv.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build OpenCV

on: workflow_dispatch
on:
push:
tags:
- "opencv-*.*.*" #

### modify here for update #####################################################
env:
Expand All @@ -14,6 +17,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Extract tag version
id: extract_tag
run: |
echo "TAG_VERSION=${GITHUB_REF#refs/tags/opencv-}" >> $GITHUB_ENV
echo "$TAG_VERSION"
if [ "$TAG_VERSION" != "${{ env.OPENCV_VERSION }}" ]; then
echo "Error: Tag version (${ env.TAG_VERSION }) does not match OPENCV_VERSION (${ env.OPENCV_VERSION })"
exit 1
fi
echo "Version check passed: $TAG_VERSION matches ${{ env.OPENCV_VERSION }}"
- name: Check for existing cache
id: cache_status
uses: actions/cache@v4
Expand Down Expand Up @@ -47,7 +61,7 @@ jobs:
with:
path: ${{ github.workspace }}/install
key: ${{env.OPENCV_VERSION}}

- name: Create a package
run: |
cd ${{ github.workspace }}/install
Expand All @@ -57,6 +71,6 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
${{ github.workspace }}/opencv-${{env.OPENCV_VERSION}}-x86-64-linux.tar.gz
${{ github.workspace }}/${{env.OPENCV_VERSION}}-x86-64-linux.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 404cd28

Please sign in to comment.