From def6ebe5df155dcf1394d4c68f47f9236036ffee Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 22:03:10 +0800 Subject: [PATCH] feat: update npm publish workflow to use github release version (#37) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Han Xiao --- .github/workflows/npm-publish.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 99f586d..19cb30d 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -20,19 +20,24 @@ jobs: - name: Install dependencies run: npm ci - - name: Run lint and tests + - name: Run lint env: BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} JINA_API_KEY: ${{ secrets.JINA_API_KEY }} GOOGLE_API_KEY: ${{ secrets.GEMINI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - run: | - npm run lint - npm test + run: npm run lint - name: Build TypeScript run: npm run build + + - name: Update version from release + run: | + # Get release tag without 'v' prefix + VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//') + # Update version in package.json + npm version $VERSION --no-git-tag-version --allow-same-version - name: Publish to npm env: