Skip to content

Commit

Permalink
fix(ci): handle rc versions properly
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p committed Feb 3, 2025
1 parent 51128d7 commit 83514cb
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,26 @@ jobs:
- name: Doc indexing webhook for tag
id: trigger-index
run: |
curl -X POST -H "Content-Type: application/json" -d "{\"tag\": \"${{steps.extract-version.outputs.version}}\", \"to_index\": [\"docs\"]}" ${{ secrets.DOC_INDEXING_WEBHOOK }}
curl -X POST -H "Content-Type: application/json" -d "{\"tag\": \"${{steps.extract-version.outputs.snapshot_version}}\", \"to_index\": [\"docs\"]}" ${{ secrets.DOC_INDEXING_WEBHOOK }}
version=${{steps.extract-version.outputs.version}}
curl -X POST -H "Content-Type: application/json" -d "{\"tag\": \"$version\", \"to_index\": [\"docs\"]}" ${{ secrets.DOC_INDEXING_WEBHOOK }}
if [ -n "${{steps.extract-version.outputs.snapshot_version}}" ]; then
snapshot_version=${{steps.extract-version.outputs.snapshot_version}}
major_version=${version%%.*}
major_snapshot_version=${snapshot_version%%.*}
: # Here we try to detect if there is a gap between stable and snapshot release, if that's the case we're probably under an RC release and that must be covered so we launch the indexing for the RC version
if [ $major_version -eq $major_snapshot_version ]; then
tmp=${version#*.}
minor_version=${tmp%%.*}
tmp=${snapshot_version#*.}
minor_snapshot_version=${tmp%%.*}
rc_minor_version=$(($minor_version + 1))
if [ $rc_version -lt $minor_snapshot_version ]; then
curl -X POST -H "Content-Type: application/json" -d "{\"tag\": \"v${major_version}.${rc_minor_version}.0-SNAPSHOT\", \"to_index\": [\"docs\"]}" ${{ secrets.DOC_INDEXING_WEBHOOK }}
fi
fi
: # Run indexing for SNAPSHOT version
curl -X POST -H "Content-Type: application/json" -d "{\"tag\": \"$snapshot_version\", \"to_index\": [\"docs\"]}" ${{ secrets.DOC_INDEXING_WEBHOOK }}
fi

0 comments on commit 83514cb

Please sign in to comment.