diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 507a5ef67..061eef9a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,6 +57,9 @@ jobs: env: NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: ./scripts/publish.sh + - name: Make sure that @asciidoctor/core has been published on npmjs + run: | + timeout 60s ./scripts/wait-asciidoctor-core-published.sh - name: Produce binaries run: ./scripts/binaries.sh # create the GitHub release diff --git a/scripts/wait-asciidoctor-core-published.sh b/scripts/wait-asciidoctor-core-published.sh new file mode 100755 index 000000000..1fd4bc356 --- /dev/null +++ b/scripts/wait-asciidoctor-core-published.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +SCRIPT=`realpath $0` +SCRIPT_PATH=`dirname ${SCRIPT}` + +cd "$SCRIPT_PATH" +cd ../packages/asciidoctor + +ASCIIDOCTOR_CORE_VERSION=$(node -e 'console.log(require("./package.json").dependencies["@asciidoctor/core"])') + +until [ $(npm view @asciidoctor/core version) = "$ASCIIDOCTOR_CORE_VERSION" ]; +do + echo "Waiting for @asciidoctor/core $ASCIIDOCTOR_CORE_VERSION to be published..." + sleep 5s +done + +echo "@asciidoctor/core $ASCIIDOCTOR_CORE_VERSION is published!" +echo "npm view @asciidoctor/core version" +npm view @asciidoctor/core version