From d77360c1526e061274a9a13747d1299952d53ba2 Mon Sep 17 00:00:00 2001 From: Jialecl Date: Tue, 10 Mar 2026 11:49:18 +0100 Subject: [PATCH] Correctly copies the version to a package inside dist --- .github/workflows/publish-next.yml | 7 +++++-- .github/workflows/publish-release.yml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-next.yml b/.github/workflows/publish-next.yml index 03c02d5..bf14482 100644 --- a/.github/workflows/publish-next.yml +++ b/.github/workflows/publish-next.yml @@ -24,10 +24,13 @@ jobs: - name: Build library run: npm run build + - name: copy package.json to dist + run: cp package.json ./dist/ + - name: Publish NEXT version to npm run: | - sed -i "s#\"version\": \"0.0.0\"#\"version\": \"0.0.0-${GITHUB_SHA:0:7}\"#" ./lib/dist/package.json - cd lib/dist + sed -i "s#\"version\": \"0.0.0\"#\"version\": \"0.0.0-${GITHUB_SHA:0:7}\"#" ./dist/package.json + cd dist npm publish --tag next --access public env: NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index c3f0805..7069c4b 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -33,10 +33,13 @@ jobs: - name: Build library run: npm run build + - name: copy package.json to dist + run: cp package.json ./dist/ + - name: Publish RELEASE to npm run: | - sed -i "s#\"version\": \"0.0.0\"#\"version\": \"${TAG_NAME}\"#" ./lib/dist/package.json - cd lib/dist + sed -i "s#\"version\": \"0.0.0\"#\"version\": \"${TAG_NAME}\"#" ./dist/package.json + cd dist npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}