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 e925eb4
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,30 @@ 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_version=${major_version#v}
major_snapshot_version=${snapshot_version%%.*}
major_snapshot_version=${major_snapshot_version#v}
: # 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%%.*}
minor_version=${minor_version#v}
tmp=${snapshot_version#*.}
minor_snapshot_version=${tmp%%.*}
minor_snapshot_version=${minor_snapshot_version#v}
rc_minor_version=$(($minor_version + 1))
if [ $rc_minor_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 e925eb4

Please sign in to comment.