From 6c6616b48e0ad0e803ee1657370a69e747e2a409 Mon Sep 17 00:00:00 2001 From: IhsenBouallegue Date: Thu, 12 Dec 2024 16:11:39 +0100 Subject: [PATCH] refactor(config): update npm package publishing process and workflow configurations --- .github/workflows/release-analysis.yml | 20 +++++++++----------- .github/workflows/release-visualization.yml | 14 ++++---------- .github/workflows/staging-analysis.yml | 2 ++ 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release-analysis.yml b/.github/workflows/release-analysis.yml index 11c636e9cd..ff9cd8cb92 100644 --- a/.github/workflows/release-analysis.yml +++ b/.github/workflows/release-analysis.yml @@ -63,18 +63,16 @@ jobs: docker push codecharta/codecharta-analysis:latest docker push codecharta/codecharta-analysis:${{ env.VERSION }} - - name: Promote npm package + - name: Publish npm package working-directory: ./analysis/node-wrapper run: | - # Get the latest staging version - STAGING_VERSION=$(npm view @codechart/analysis@staging version) - - # Download the staging package - npm pack @codechart/analysis@staging - - # Update version and publish as latest - npm version ${{ env.VERSION }} --no-git-tag-version - npm publish codechart-analysis-${STAGING_VERSION}.tgz --tag latest + # Prepare the package + npm ci + npm run prepare + + # Update version and publish + npm version ${{ env.VERSION }} --no-git-tag-version --allow-same-version + npm publish --tag latest env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -105,4 +103,4 @@ jobs: token: ${{ secrets.DEPLOY_TOKEN }} branch: gh-pages folder: gh-pages - clean: true + clean: false diff --git a/.github/workflows/release-visualization.yml b/.github/workflows/release-visualization.yml index 4143486529..1cb16e9b1d 100644 --- a/.github/workflows/release-visualization.yml +++ b/.github/workflows/release-visualization.yml @@ -79,18 +79,12 @@ jobs: docker push codecharta/codecharta-visualization:latest docker push codecharta/codecharta-visualization:${{ env.VERSION }} - - name: Promote npm package + - name: Publish npm package working-directory: ./visualization run: | - # Get the latest staging version - STAGING_VERSION=$(npm view codecharta-visualization@staging version) - - # Download the staging package - npm pack codecharta-visualization@staging - - # Update version and publish as latest - npm version ${{ env.VERSION }} --no-git-tag-version - npm publish codecharta-visualization-${STAGING_VERSION}.tgz --tag latest + # Update version and publish + npm version ${{ env.VERSION }} --no-git-tag-version --allow-same-version + npm publish --tag latest env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/staging-analysis.yml b/.github/workflows/staging-analysis.yml index 139997e7d7..e2faa04cc1 100644 --- a/.github/workflows/staging-analysis.yml +++ b/.github/workflows/staging-analysis.yml @@ -64,6 +64,8 @@ jobs: - name: Publish to npm working-directory: ./analysis/node-wrapper run: | + npm ci + npm run prepare npm publish --tag staging env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}