From 125fbeb205b2d9d6c7842d10e42fe0413f820be7 Mon Sep 17 00:00:00 2001 From: Ritsaert Hornstra Date: Wed, 8 Jan 2025 13:08:04 +0100 Subject: [PATCH 1/7] Add permission to gh action for publishing npm --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2d07023..9654ad4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,7 @@ jobs: permissions: contents: read id-token: write + packages: write steps: - name: Setup repo From 9b4cb77c02ec60cce805f0012d4d914c327042b8 Mon Sep 17 00:00:00 2001 From: Ritsaert Hornstra Date: Wed, 8 Jan 2025 13:08:26 +0100 Subject: [PATCH 2/7] format config schema in build step --- configSchema/testReportConfigSchema.json | 2 +- deno.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configSchema/testReportConfigSchema.json b/configSchema/testReportConfigSchema.json index b34a0fc..1f473f4 100644 --- a/configSchema/testReportConfigSchema.json +++ b/configSchema/testReportConfigSchema.json @@ -195,4 +195,4 @@ "input" ], "additionalProperties": false -} +} \ No newline at end of file diff --git a/deno.json b/deno.json index f67c966..38e389e 100644 --- a/deno.json +++ b/deno.json @@ -24,7 +24,7 @@ "build": "deno run -A build.ts", "all": "deno lint && deno fmt && deno check ./src/mod.ts && deno task test && deno task build && deno fmt", "publish_jsr": "deno publish", - "publish_npm": "deno task build && cd npm && npm publish --public" + "publish_npm": "deno task build && deno fmt && cd npm && npm publish --public" }, "imports": { "@continuit/xmlscanner": "jsr:@continuit/xmlscanner@^1.0.0", From 289bf4b7b48282791accdf04acb9544b8081bbb8 Mon Sep 17 00:00:00 2001 From: Ritsaert Hornstra Date: Wed, 8 Jan 2025 13:09:39 +0100 Subject: [PATCH 3/7] Upped version number --- configSchema/testReportConfigSchema.json | 2 +- deno.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configSchema/testReportConfigSchema.json b/configSchema/testReportConfigSchema.json index 1f473f4..b34a0fc 100644 --- a/configSchema/testReportConfigSchema.json +++ b/configSchema/testReportConfigSchema.json @@ -195,4 +195,4 @@ "input" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/deno.json b/deno.json index 38e389e..8b0097d 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@continuit/testreport", - "version": "0.1.2", + "version": "0.1.3", "description": "Generates a test report and badges from your test and coverage results. Allows checking the report in your CI pipeline.", "keywords": [ "test", From 245db9a13cd4b2ae15775951f002e33915af433c Mon Sep 17 00:00:00 2001 From: Ritsaert Hornstra Date: Wed, 8 Jan 2025 13:16:39 +0100 Subject: [PATCH 4/7] Perform dry run of npm publishing on pull request --- .github/workflows/ci.yml | 14 ++++++++++++-- deno.json | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39aa507..72778a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,5 +34,15 @@ jobs: - name: Run tests, coverage, create test report and badges run: deno task test - - name: Try to build npm package - run: deno task build + - name: Setup Node / NPM + uses: actions/setup-node@v4 + with: + node-version: '22.x' + registry-url: 'https://npm.pkg.github.com' + scope: '@continuit' + + - name: Build npm package + run: deno task publish_npm_dry + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/deno.json b/deno.json index 8b0097d..30776fc 100644 --- a/deno.json +++ b/deno.json @@ -24,7 +24,8 @@ "build": "deno run -A build.ts", "all": "deno lint && deno fmt && deno check ./src/mod.ts && deno task test && deno task build && deno fmt", "publish_jsr": "deno publish", - "publish_npm": "deno task build && deno fmt && cd npm && npm publish --public" + "publish_npm": "deno task build && deno fmt && cd npm && npm publish --public", + "publish_npm_dry": "deno task build && deno fmt && cd npm && npm publish --dry-run" }, "imports": { "@continuit/xmlscanner": "jsr:@continuit/xmlscanner@^1.0.0", From 129efc32deb130ecf384be767edad99972d71eee Mon Sep 17 00:00:00 2001 From: Ritsaert Hornstra Date: Wed, 8 Jan 2025 13:20:51 +0100 Subject: [PATCH 5/7] add deno fmt to build task, fmt fix --- .github/workflows/ci.yml | 1 - deno.json | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72778a3..7072fbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,4 +45,3 @@ jobs: run: deno task publish_npm_dry env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/deno.json b/deno.json index 30776fc..7db1f51 100644 --- a/deno.json +++ b/deno.json @@ -21,11 +21,11 @@ "test": "deno task test_prepare && deno test -RSW --coverage --clean --junit-path test_results/junit.xml && deno coverage --lcov --output=test_results/cov.lcov && deno coverage && deno run -RW ./src/mod.ts ./testreport.json", "test_prepare": "rm -rf test_output && mkdir -p test_output && mkdir -p test_output/deno_success && mkdir -p test_output/deno_disabled && mkdir -p test_output/deno_failed && mkdir -p test_output/jest && mkdir -p test_output/vitest && mkdir -p test_output/no_tests && mkdir -p test_output/invalid_input && mkdir -p test_output/invalid_output", "clean": "rm -rf test_output && rm -rf coverage", - "build": "deno run -A build.ts", - "all": "deno lint && deno fmt && deno check ./src/mod.ts && deno task test && deno task build && deno fmt", + "build": "deno run -A build.ts && deno fmt", + "all": "deno lint && deno fmt && deno check ./src/mod.ts && deno task test && deno task build", "publish_jsr": "deno publish", - "publish_npm": "deno task build && deno fmt && cd npm && npm publish --public", - "publish_npm_dry": "deno task build && deno fmt && cd npm && npm publish --dry-run" + "publish_npm": "deno task build && cd npm && npm publish --public", + "publish_npm_dry": "deno task build && cd npm && npm publish --dry-run" }, "imports": { "@continuit/xmlscanner": "jsr:@continuit/xmlscanner@^1.0.0", From 571ed104be6d4381a4d5370ee9805a0116f93339 Mon Sep 17 00:00:00 2001 From: Ritsaert Hornstra Date: Wed, 8 Jan 2025 13:23:15 +0100 Subject: [PATCH 6/7] Small textual clarification --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7072fbc..60d5dd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: registry-url: 'https://npm.pkg.github.com' scope: '@continuit' - - name: Build npm package + - name: Dry run build npm package run: deno task publish_npm_dry env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 99d330285057e2c44d93ed5a4684fb5337f58593 Mon Sep 17 00:00:00 2001 From: Ritsaert Hornstra Date: Wed, 8 Jan 2025 13:26:13 +0100 Subject: [PATCH 7/7] fmt fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60d5dd8..bb35c68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: registry-url: 'https://npm.pkg.github.com' scope: '@continuit' - - name: Dry run build npm package + - name: Dry run build npm package run: deno task publish_npm_dry env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}