From 446cda7cc8f6c0a9f3f51739b7b1116f7abddba3 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Tue, 23 Jul 2024 18:08:55 +0200 Subject: [PATCH 1/6] ci: don't run packaging workflow if the buid fails --- .github/workflows/packaging.yaml | 8 ++++---- tsconfig.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/packaging.yaml b/.github/workflows/packaging.yaml index 6a63b99..54266a6 100644 --- a/.github/workflows/packaging.yaml +++ b/.github/workflows/packaging.yaml @@ -3,10 +3,10 @@ name: GitHub release and NPM publishing on: - push: - branches: - - main - pull_request: + workflow_run: + workflows: ['Build, test and check format'] + types: + - completed branches: - main diff --git a/tsconfig.json b/tsconfig.json index 57d0fd0..8d4bac4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,8 +11,8 @@ "types": ["jest", "node"], "declaration": true, "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, + "allowSyntheticDefaultImports": true }, "include": ["src"], - "exclude": ["./node_modules/", "./dist/", "./jest.config.js", "./test/"], + "exclude": ["./node_modules/", "./dist/", "./jest.config.js", "./test/"] } From c08e76ecc7d727f01394a0ae5e6b527573bde8cc Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Tue, 23 Jul 2024 18:29:10 +0200 Subject: [PATCH 2/6] pkg: try to fix the package definition --- package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index d30f087..ae62c8d 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,6 @@ "version": "1.2.3", "description": "A set of utility functions to build tools around Publicodes models", "type": "module", - "main": "dist/index.cjs", - "module": "dist/index.js", - "types": "dist/index.d.ts", "scripts": { "build": "tsup", "watch": "tsup --watch", @@ -77,6 +74,7 @@ "typescript": "^4.9.4" }, "tsup": { + "allowJs": true, "entry": [ "src/index.ts", "src/optims/index.ts", From 6dd90ef6e777997f547fbc6d0fd26f648ec66dd8 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Tue, 23 Jul 2024 18:29:15 +0200 Subject: [PATCH 3/6] v1.2.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ae62c8d..6bbc42c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@publicodes/tools", - "version": "1.2.3", + "version": "1.2.4", "description": "A set of utility functions to build tools around Publicodes models", "type": "module", "scripts": { From 674e6ba7b10a2a1b5d1b06c3ca0e4e4e70f991ff Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Wed, 24 Jul 2024 17:04:20 +0200 Subject: [PATCH 4/6] pkg: try to correctly define the package.json file --- package.json | 5 ++--- tsconfig.json | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6bbc42c..e2230f8 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.2.4", "description": "A set of utility functions to build tools around Publicodes models", "type": "module", + "main": "dist/index.js", "scripts": { "build": "tsup", "watch": "tsup --watch", @@ -74,14 +75,12 @@ "typescript": "^4.9.4" }, "tsup": { - "allowJs": true, "entry": [ "src/index.ts", "src/optims/index.ts", "src/compilation/index.ts", "src/migration/index.ts" ], - "cjsInterop": true, "format": [ "cjs", "esm" @@ -89,7 +88,7 @@ "sourceMap": true, "dts": true, "clean": true, - "skipNodeModulesBundle": true + "cjsInterop": true }, "publishConfig": { "access": "public" diff --git a/tsconfig.json b/tsconfig.json index 8d4bac4..f2fe015 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, + "allowJs": true, "sourceMap": true, "types": ["jest", "node"], "declaration": true, From 384b0c0df00227e5470157d91c078b0159a41b5d Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Wed, 24 Jul 2024 17:04:24 +0200 Subject: [PATCH 5/6] v1.2.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e2230f8..54f3804 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@publicodes/tools", - "version": "1.2.4", + "version": "1.2.5", "description": "A set of utility functions to build tools around Publicodes models", "type": "module", "main": "dist/index.js", From e3bd88f91a95fe2d103d0d14c106c15aeacfc6a1 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Wed, 24 Jul 2024 17:08:46 +0200 Subject: [PATCH 6/6] ci: publish when is_upgraded_version === true --- .github/workflows/packaging.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/packaging.yaml b/.github/workflows/packaging.yaml index 54266a6..2b13b8e 100644 --- a/.github/workflows/packaging.yaml +++ b/.github/workflows/packaging.yaml @@ -39,11 +39,7 @@ jobs: # We create release only if the version in the package.json have been upgraded and this CI is running against the main branch. # We allow branches with a PR open on main to publish pre-release (x.y.z-rc.u) but not actual releases. if: | - needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' && - ( - github.event_name == 'push' || - needs.check_if_version_upgraded.outputs.is_pre_release == 'true' - ) + needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' needs: - check_if_version_upgraded steps: