diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7607ac7..e3bb5eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,9 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Update npm + run: sudo npm install -g npm@11.5.1 + - name: Compile run: pnpm build @@ -67,24 +70,10 @@ jobs: - name: Publish to npm run: | - npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} - publish() { # use latest npm to ensure OIDC support - npx -y npm@latest publish "$@" - } - if [[ ${GITHUB_REF} == *alpha* ]]; then - publish --access public --tag alpha - elif [[ ${GITHUB_REF} == *beta* ]]; then - publish --access public --tag beta - else - PKG_NAME=$(node -p "require('./package.json').name") - PKG_VERSION=$(node -p "require('./package.json').version") - CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0") - if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then - echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})" - publish --access public --tag backport - else - publish --access public - fi - fi - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + if [[ ${GITHUB_REF} == *alpha* ]]; then + npm publish --access public --tag alpha + elif [[ ${GITHUB_REF} == *beta* ]]; then + npm publish --access public --tag beta + else + npm publish --access public + fi