From ae6dcf795b98a040025a61a43c1658669edbe30d Mon Sep 17 00:00:00 2001 From: saumyaj3 Date: Thu, 13 Feb 2025 17:23:34 +0100 Subject: [PATCH] Add support for alias tagging during npm package publishing Updated the workflow to publish with a 'latest' tag when on the main branch. This ensures proper versioning and aliasing for packages published to GitHub Packages. --- .github/workflows/npm-package.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-package.yml b/.github/workflows/npm-package.yml index cdba75f2..8b9e9c7f 100644 --- a/.github/workflows/npm-package.yml +++ b/.github/workflows/npm-package.yml @@ -43,9 +43,15 @@ jobs: registry-url: 'https://npm.pkg.github.com' scope: '@ultimaker' - - name: Publish to GitHub Packages + - name: Publish to GitHub Packages (with version) + run: npm publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to GitHub Packages (with alias) + if: ${{ github.ref_name == 'main' }} run: | - npm publish + npm publish --tag latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}