message: fix: npm publish race condition w/ git tag
diff: @@ -117,55 +117,36 @@ jobs:
  echo PRE_RELEASE=false >> $GITHUB_ENV
  fi
  - - name: Check If Tag Exists
  - id: tag_check
  - shell: bash -ex {0}
  - run: |
  - GET_API_URL="https://api.github.com/repos/${{github.repository}}/git/ref/tags/${{env.RELEASE_VERSION}}"
  - http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \
  - -H "Authorization: token ${GITHUB_TOKEN}")
  - if [ "$http_status_code" -ne "404" ] ; then
  - echo TAG_EXISTS=true >> $GITHUB_ENV
  - else
  - echo TAG_EXISTS=false >> $GITHUB_ENV
  - fi
  - env:
  - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  -
  - name: Setup Node.js
  uses: actions/setup-node@v1
  with:
  node-version: '${{env.NVMRC}}'
  - name: Auth into NPM
  - if: env.TAG_EXISTS == 'false'
  run: |
  npm config set registry https://registry.npmjs.org/
  npm config set //registry.npmjs.org/:_authToken=${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}
  echo $(npm whoami --registry https://registry.npmjs.org/)
  - name: Install JS dependencies
  - if: env.TAG_EXISTS == 'false'
  run: yarn install --nonInteractive --frozen-lockfile
  - name: Build JS packages
  - if: env.TAG_EXISTS == 'false'
  run: yarn build
  - name: Publish Node Packages To NPM (Latest)
  - if: env.TAG_EXISTS == 'false' && env.PRE_RELEASE == 'false'
  + if: env.PRE_RELEASE == 'false'
  run: yarn publish:npm
  env:
  NPM_AUTH_TOKEN: ${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}
  - name: Publish Node Packages To NPM (Pre-Release)
  - if: env.TAG_EXISTS == 'false' && env.PRE_RELEASE == 'true'
  + if: env.PRE_RELEASE == 'true'
  run: yarn publish:pre:npm
  env:
  NPM_AUTH_TOKEN: ${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}
  - uses: actions/github-script@0.8.0
  - if: env.TAG_EXISTS == 'false'
  with:
  github-token: ${{secrets.GITHUB_TOKEN}}
  script: |
  