diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 00000000..ea186d40 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", + "changelog": [ + "@changesets/changelog-github", + { "repo": "nodesecure/cli" } + ], + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "master", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml new file mode 100644 index 00000000..24637ebd --- /dev/null +++ b/.github/workflows/changesets.yml @@ -0,0 +1,48 @@ +name: Changesets +on: + push: + branches: + - master +env: + CI: true + +jobs: + version: + timeout-minutes: 15 + runs-on: ubuntu-latest + permissions: + id-token: write # Required for OIDC publishing + contents: write # Required for changesets to push version commit + pull-requests: write # Required for changesets to create PRs + steps: + - name: Checkout code repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - name: Setup node.js + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version: 24 + registry-url: 'https://registry.npmjs.org' + + - name: Install latest npm + run: npm install -g npm@latest + + - name: Install dependencies + run: npm install --ignore-scripts + + - name: Build monorepo + run: npm run build + + - name: Update and publish versions + uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 + with: + version: npm run ci:version + commit: "chore: update versions" + title: "chore: update versions" + publish: npm run ci:publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: "" + NPM_CONFIG_PROVENANCE: true diff --git a/package.json b/package.json index 570456f1..a7957476 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,8 @@ "test:cli": "node --no-warnings --test test/**/*.test.js", "test:all": "npm run test --ws --if-present", "coverage": "c8 --reporter=lcov npm run test", + "ci:publish": "changeset publish", + "ci:version": "changeset version", "clean": "clear-ts-build" }, "files": [ @@ -69,6 +71,8 @@ }, "homepage": "https://github.com/NodeSecure/cli#readme", "devDependencies": { + "@changesets/changelog-github": "0.6.0", + "@changesets/cli": "2.30.0", "@nodesecure/size-satisfies": "^1.1.0", "@nodesecure/vis-network": "^1.4.0", "@openally/config.eslint": "^2.4.2", diff --git a/workspaces/cache/package.json b/workspaces/cache/package.json index c6932d2c..f3efc736 100644 --- a/workspaces/cache/package.json +++ b/workspaces/cache/package.json @@ -15,6 +15,16 @@ "test": "node --test test/**.test.ts", "test:c8": "c8 npm run test" }, + "publishConfig": { + "registry": "https://registry.npmjs.org", + "access": "public", + "provenance": true + }, + "repository": { + "type": "git", + "url": "https://github.com/NodeSecure/cli", + "directory": "workspaces/cache" + }, "author": "GENTILHOMME Thomas ", "license": "MIT", "dependencies": { diff --git a/workspaces/documentation-ui/package.json b/workspaces/documentation-ui/package.json index c9ef3175..27895069 100644 --- a/workspaces/documentation-ui/package.json +++ b/workspaces/documentation-ui/package.json @@ -7,6 +7,16 @@ "example": "npm run example:build && http-server ./dist", "example:build": "node esbuild.config.js" }, + "publishConfig": { + "registry": "https://registry.npmjs.org", + "access": "public", + "provenance": true + }, + "repository": { + "type": "git", + "url": "https://github.com/NodeSecure/cli", + "directory": "workspaces/documentation-ui" + }, "files": [ "index.js", "src" diff --git a/workspaces/server/package.json b/workspaces/server/package.json index 87be866c..306618d6 100644 --- a/workspaces/server/package.json +++ b/workspaces/server/package.json @@ -15,6 +15,16 @@ "test": "node --test ./test/**/*.test.ts", "test:c8": "c8 npm run test" }, + "publishConfig": { + "registry": "https://registry.npmjs.org", + "access": "public", + "provenance": true + }, + "repository": { + "type": "git", + "url": "https://github.com/NodeSecure/cli", + "directory": "workspaces/server" + }, "author": "GENTILHOMME Thomas ", "license": "MIT", "devDependencies": { diff --git a/workspaces/size-satisfies/package.json b/workspaces/size-satisfies/package.json index b8d8aa45..8981f4c8 100644 --- a/workspaces/size-satisfies/package.json +++ b/workspaces/size-satisfies/package.json @@ -9,9 +9,15 @@ "test-only": "node --test test/test.js", "test": "npm run lint && npm run test-only" }, + "publishConfig": { + "registry": "https://registry.npmjs.org", + "access": "public", + "provenance": true + }, "repository": { "type": "git", - "url": "git+https://github.com/NodeSecure/cli.git" + "url": "https://github.com/NodeSecure/cli", + "directory": "workspaces/size-satisfies" }, "files": [ "index.js", diff --git a/workspaces/vis-network/package.json b/workspaces/vis-network/package.json index b2757734..736faada 100644 --- a/workspaces/vis-network/package.json +++ b/workspaces/vis-network/package.json @@ -12,6 +12,16 @@ "start": "npm run build && http-server ./dist", "build": "rimraf ./dist && node esbuild.config.js" }, + "publishConfig": { + "registry": "https://registry.npmjs.org", + "access": "public", + "provenance": true + }, + "repository": { + "type": "git", + "url": "https://github.com/NodeSecure/cli", + "directory": "workspaces/vis-network" + }, "files": [ "index.js", "src"