@@ -104,34 +104,42 @@ jobs:
104104 # wranglerVersion: 3.101.0
105105
106106# see: https://youtrack.jetbrains.com/issue/WRS-7233/Algolia-publisher-2.0.32-3-fails-with-UnrecognizedPropertyException-for-contentBoost-field-generated-by-Writerside-builder
107- # publish-indexes:
108- # needs: [ build, test, deploy ]
109- # runs-on: ubuntu-latest
110- # container:
111- # image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:latest
112- #
113- # steps:
114- # - name: Download artifact
115- # uses: actions/download-artifact@v4
116- # with:
117- # name: docs
118- # path: artifacts
119- #
120- # - name: Unzip Algolia artifact
121- # run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.algolia_artifact }}" -d algolia-indexes
122- #
123- # - name: Update Algolia Index
124- # run: |
125- # if [ -z "${{ secrets.ALGOLIA_KEY }}" ]; then
126- # echo "ALGOLIA_KEY secret is not set in GitHub Secrets"
127- # exit 1
128- # else
129- # env "algolia-key=${{ secrets.ALGOLIA_KEY }}" java -jar /opt/builder/help-publication-agent.jar \
130- # update-index \
131- # --application-name ${{ env.ALGOLIA_APP_NAME }} \
132- # --index-name ${{ env.ALGOLIA_INDEX_NAME }} \
133- # --product ${{ env.CONFIG_JSON_PRODUCT }} \
134- # --version ${{ env.CONFIG_JSON_VERSION }} \
135- # --index-directory algolia-indexes/ \
136- # 2>&1 | tee algolia-update-index-log.txt
137- # fi
107+ publish-indexes :
108+ needs : [ build, test, deploy ]
109+ runs-on : ubuntu-latest
110+ container :
111+ image : registry.jetbrains.team/p/writerside/builder/algolia-publisher:latest
112+
113+ steps :
114+ - name : Download artifact
115+ uses : actions/download-artifact@v4
116+ with :
117+ name : docs
118+ path : artifacts
119+
120+ - name : Unzip Algolia artifact
121+ run : unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.algolia_artifact }}" -d algolia-indexes
122+
123+ - name : Remove contentBoost field from index files
124+ run : |
125+ cd algolia-indexes
126+ shopt -s nullglob
127+ for f in *.json; do
128+ sed -i -E 's/"contentBoost":[0-9]+,//g; s/,"contentBoost":[0-9]+//g' "$f"
129+ done
130+
131+ - name : Update Algolia Index
132+ run : |
133+ if [ -z "${{ secrets.ALGOLIA_KEY }}" ]; then
134+ echo "ALGOLIA_KEY secret is not set in GitHub Secrets"
135+ exit 1
136+ else
137+ env "algolia-key=${{ secrets.ALGOLIA_KEY }}" java -jar /opt/builder/help-publication-agent.jar \
138+ update-index \
139+ --application-name ${{ env.ALGOLIA_APP_NAME }} \
140+ --index-name ${{ env.ALGOLIA_INDEX_NAME }} \
141+ --product ${{ env.CONFIG_JSON_PRODUCT }} \
142+ --version ${{ env.CONFIG_JSON_VERSION }} \
143+ --index-directory algolia-indexes/ \
144+ 2>&1 | tee algolia-update-index-log.txt
145+ fi
0 commit comments