From e6076d2d929a1fd5197f38b2e1d34ec328df9690 Mon Sep 17 00:00:00 2001 From: Space Corp Engineering Date: Wed, 10 Jul 2024 19:52:21 +0200 Subject: [PATCH] chore: set npm auth from the pipeline --- .github/workflows/npm-publish-github-packages.yml | 3 +++ packages/gleamy/package.json | 7 +++++-- packages/gleamy/scripts/entitiesToPack.json | 7 +++---- packages/gleamy/scripts/postpack.cjs | 2 +- packages/gleamy/scripts/prepare.cjs | 6 +++++- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml index 390b9ad..4aabaef 100644 --- a/.github/workflows/npm-publish-github-packages.yml +++ b/.github/workflows/npm-publish-github-packages.yml @@ -48,6 +48,9 @@ jobs: - run: pnpm install - run: echo "publishing version ${{ env.RELEASE_VERSION }}" - run: pnpm version ${{ env.RELEASE_VERSION }} + - run: npm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_PUBLISH_TOKEN}} + - run: pnpm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_PUBLISH_TOKEN}} + - run: npm profile get - run: pnpm publish:package env: node-version: ${{ matrix.node-version }} diff --git a/packages/gleamy/package.json b/packages/gleamy/package.json index 57b1092..b21886d 100644 --- a/packages/gleamy/package.json +++ b/packages/gleamy/package.json @@ -1,7 +1,7 @@ { "name": "gleamy", "description": "Create a reactive shiny element in different materials", - "version": "2.0.2", + "version": "2.0.10-beta", "license": "MIT", "private": false, "sideEffects": false, @@ -20,6 +20,9 @@ }, "type": "module", "module": "dist/esm/index.mjs", + "directories": { + "dist": "dist/**/*" + }, "files": [ "dist", "README.md", @@ -58,7 +61,7 @@ "test": "jest", "prepack": "node ./scripts/prepare.cjs", "postpack": "node ./scripts/postpack.cjs", - "publish:package": "pnpm publish --no-git-checks --access=public", + "publish:package": "pnpm publish --force --no-git-checks --access=public", "dry-run": "pnpm publish --dry-run --no-git-checks --access=public" }, "peerDependencies": { diff --git a/packages/gleamy/scripts/entitiesToPack.json b/packages/gleamy/scripts/entitiesToPack.json index 3804e9b..7904407 100644 --- a/packages/gleamy/scripts/entitiesToPack.json +++ b/packages/gleamy/scripts/entitiesToPack.json @@ -1,12 +1,11 @@ { "entitiesToPack": [ - "readme-assets", + "dist", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "FUNDING.md", "LICENSE.md", "README.md", - "SECURITY.md", - "dist" + "SECURITY.md" ] -} +} \ No newline at end of file diff --git a/packages/gleamy/scripts/postpack.cjs b/packages/gleamy/scripts/postpack.cjs index 4be80f2..b980fe5 100644 --- a/packages/gleamy/scripts/postpack.cjs +++ b/packages/gleamy/scripts/postpack.cjs @@ -7,7 +7,7 @@ console.log('Gleamy: cleaning up.'); try { result.entitiesToPack.forEach((entity) => { if (entity === "dist") { - return void(0); + return void (0); } fs.rmSync(`../../packages/gleamy/${entity}`, { recursive: true }); }); diff --git a/packages/gleamy/scripts/prepare.cjs b/packages/gleamy/scripts/prepare.cjs index da6a560..b4a6558 100644 --- a/packages/gleamy/scripts/prepare.cjs +++ b/packages/gleamy/scripts/prepare.cjs @@ -9,12 +9,16 @@ try { result.entitiesToPack.forEach((entity) => { console.log(entity); if (entity === "dist") { - return void(0); + return void (0); } fs.cpSync(`../../${entity}`, `../../packages/gleamy/${entity}`, { recursive: true, }); }); + + fs.cpSync(`./dist`, `../../packages/gleamy/dist`, { + recursive: true, + }); } catch (error) { console.error(error); }