diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 2c629ae..eb8ce7e 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -36,7 +36,24 @@ jobs: - name: Configure npm for GitHub Packages run: | echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc - echo "@wojtekKrol:registry=https://npm.pkg.github.com" >> ~/.npmrc + echo "@wojtekkrol:registry=https://npm.pkg.github.com" >> ~/.npmrc + + - name: Insert repository owner as scope into package name + run: | + cp package.json package.json.bak + node < JSON.parse(data)).then((json) => { + json.name = '@' + process.env.GITHUB_REPOSITORY.split('/')[0].toLowerCase() + '/' + json.name; + console.info('Package name changed to %s', json.name); + return fs.writeFile('package.json', JSON.stringify(json, null, 2), 'utf8'); + }).catch(error => { + console.error(error); + process.exit(1); + }); + EOF + env: + GITHUB_REPOSITORY: ${{ github.repository }} - name: Insert repository owner as scope into package name run: | diff --git a/package.json b/package.json index d06fd49..b2fa49e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zod-to-fields", - "version": "0.1.32", + "version": "0.1.33", "description": "Turn your Zod schemas into configurable field arrays for easy integration with HTML, React, Vue, and more.", "main": "lib/cjs/index.js", "module": "lib/esm/index.js", @@ -12,7 +12,7 @@ "bugs": "https://github.com/wojtekKrol/zod-to-fields/issues" }, "publishConfig": { - "registry": "https://npm.pkg.github.com/@wojtekKrol" + "registry": "https://npm.pkg.github.com/@wojtekkrol" }, "engines": { "node": ">=18" @@ -64,7 +64,7 @@ "coverage": "jest --coverage", "test": "jest", "publish:npm": "pnpm publish --access public", - "publish:github": "pnpm publish --registry=https://npm.pkg.github.com/" + "publish:github": "pnpm publish --registry=https://npm.pkg.github.com/ --no-git-checks" }, "devDependencies": { "@changesets/cli": "^2.27.6",