Skip to content

Commit

Permalink
refactor(config): update npm package publishing process and workflow …
Browse files Browse the repository at this point in the history
…configurations
  • Loading branch information
IhsenBouallegue committed Dec 12, 2024
1 parent 2963ec9 commit 6c6616b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/release-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -105,4 +103,4 @@ jobs:
token: ${{ secrets.DEPLOY_TOKEN }}
branch: gh-pages
folder: gh-pages
clean: true
clean: false
14 changes: 4 additions & 10 deletions .github/workflows/release-visualization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/staging-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 6c6616b

Please sign in to comment.