Skip to content

Commit c413805

Browse files
authored
Merge pull request #38 from VapiAI/update-ci.yml
Update ci.yml
2 parents 4ef6132 + 389d6ab commit c413805

1 file changed

Lines changed: 10 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: Install dependencies
2424
run: pnpm install --frozen-lockfile
2525

26+
- name: Update npm
27+
run: sudo npm install -g npm@11.5.1
28+
2629
- name: Compile
2730
run: pnpm build
2831

@@ -67,24 +70,10 @@ jobs:
6770

6871
- name: Publish to npm
6972
run: |
70-
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
71-
publish() { # use latest npm to ensure OIDC support
72-
npx -y npm@latest publish "$@"
73-
}
74-
if [[ ${GITHUB_REF} == *alpha* ]]; then
75-
publish --access public --tag alpha
76-
elif [[ ${GITHUB_REF} == *beta* ]]; then
77-
publish --access public --tag beta
78-
else
79-
PKG_NAME=$(node -p "require('./package.json').name")
80-
PKG_VERSION=$(node -p "require('./package.json').version")
81-
CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0")
82-
if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then
83-
echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})"
84-
publish --access public --tag backport
85-
else
86-
publish --access public
87-
fi
88-
fi
89-
env:
90-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
if [[ ${GITHUB_REF} == *alpha* ]]; then
74+
npm publish --access public --tag alpha
75+
elif [[ ${GITHUB_REF} == *beta* ]]; then
76+
npm publish --access public --tag beta
77+
else
78+
npm publish --access public
79+
fi

0 commit comments

Comments
 (0)