diff --git a/.github/actions/restore-artifacts/action.yml b/.github/actions/restore-artifacts/action.yml index b1b4e6b3c33..48476c1ddc9 100644 --- a/.github/actions/restore-artifacts/action.yml +++ b/.github/actions/restore-artifacts/action.yml @@ -53,6 +53,17 @@ runs: path: clients/algoliasearch-client-javascript/packages/requester-node-http/ # JavaScript + - name: Download client-javascript-algoliasearch artifact + if: ${{ inputs.javascript == 'true' && inputs.type == 'all' }} + uses: actions/download-artifact@v3 + with: + name: client-javascript-algoliasearch + + - name: Unzip client-javascript-algoliasearch artifact + if: ${{ inputs.javascript == 'true' && inputs.type == 'all' }} + shell: bash + run: unzip -q -o client-javascript-algoliasearch.zip && rm client-javascript-algoliasearch.zip + - name: Download clients-javascript artifact if: ${{ inputs.javascript == 'true' && inputs.type == 'all' }} uses: actions/download-artifact@v3 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index cddd95fedee..4fee087acdd 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -288,12 +288,23 @@ jobs: if: ${{ steps.cache.outputs.cache-hit != 'true' }} run: yarn cli build clients javascript algoliasearch + - name: Zip artifact before storing + run: zip -r -y client-javascript-algoliasearch.zip clients/algoliasearch-client-javascript/packages/algoliasearch/ -x "**/node_modules/**" "**/node_modules/.**" "clients/algoliasearch-client-javascript/.yarn/**" + + - name: Store JavaScript 'algoliasearch' client + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: client-javascript-algoliasearch + path: client-javascript-algoliasearch.zip + codegen: runs-on: ubuntu-20.04 timeout-minutes: 10 needs: - setup - client_gen + - client_javascript_algoliasearch if: | always() && !contains(needs.*.result, 'cancelled') && @@ -305,11 +316,6 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} token: ${{ secrets.TOKEN_GENERATE_BOT }} - - name: Setup - uses: ./.github/actions/setup - with: - type: minimal - - name: Download all artifacts if: ${{ needs.setup.outputs.RUN_CODEGEN == 'true' }} uses: ./.github/actions/restore-artifacts @@ -319,6 +325,11 @@ jobs: php: ${{ needs.setup.outputs.RUN_GEN_PHP }} java: ${{ needs.setup.outputs.RUN_GEN_JAVA }} + - name: Setup + uses: ./.github/actions/setup + with: + type: minimal + - name: Push generated code id: pushGeneratedCode run: yarn workspace scripts pushGeneratedCode diff --git a/netlify.toml b/netlify.toml index 8f1b035b456..4f85e996433 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,7 +1,7 @@ [build] command="BUNDLE_WITH_DOC=true DOCKER=true yarn cli build specs all && yarn website:build" publish="website/build" - ignore="git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- website/ specs/" + ignore="bash ./scripts/website/netlify-ignore-build.sh" [build.environment] YARN_VERSION = "3.1.1" diff --git a/scripts/website/netlify-ignore-build.sh b/scripts/website/netlify-ignore-build.sh new file mode 100755 index 00000000000..95afbea8195 --- /dev/null +++ b/scripts/website/netlify-ignore-build.sh @@ -0,0 +1,7 @@ +# This $BRANCH variable comes from the Netlify env +if [[ $BRANCH == chore/prepare-release-* ]] ; +then + exit 0 +else + git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- website/ specs/ && exit $? +fi