From 73d2d74f3ed7ac13ff9abac481adc50a9d177548 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Tue, 23 Jan 2024 12:36:22 -0800 Subject: [PATCH 1/2] feat: release automation changes --- .github/workflows/publish.yml | 2 +- bin/version.ts | 7 ++++++- package.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 374cdffef..56f0d2109 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -49,7 +49,7 @@ jobs: run: npm list - run: npm ci - run: npm audit - - run: npm publish + - run: npm publish -ws env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/bin/version.ts b/bin/version.ts index 56babb4a5..dbd16ce22 100644 --- a/bin/version.ts +++ b/bin/version.ts @@ -5,6 +5,7 @@ import fs from 'fs'; import path from 'path'; import { exec } from 'child_process'; +import prettier from 'prettier'; import process from 'process'; console.time('script duration'); @@ -52,8 +53,12 @@ workspaces.forEach(async workspace => { json.devDependencies = updateDeps(json.devDependencies); } + const formatted = prettier.format(JSON.stringify(json), { + parser: 'json-stringify', + }); + // Write file - fs.writeFileSync(packagePath, JSON.stringify(json)); + fs.writeFileSync(packagePath, formatted); }); function updateDeps(dependencies: Record) { diff --git a/package.json b/package.json index f76e52c26..734425905 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "git push --set-upstream origin release/${version}" ], "after:release": [ - "gh pr create --base main --title 'chore: release ${version}' --body 'GitHub Release: ${releaseUrl}\nNPM release: https://www.npmjs.com/package/@dfinity/agent/v/${version}'" + "gh pr create --base main --title 'chore: release ${version}' --body 'GitHub Release: ${releaseUrl}\nNPM release: https://www.npmjs.com/package/@dfinity/agent/v/${version}'`n[ ] Check this box to trigger CI" ] }, "git": { From 4697ac716148234d71fe1ca0b6ce59019868f7d3 Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Tue, 23 Jan 2024 12:36:33 -0800 Subject: [PATCH 2/2] changelog --- docs/generated/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/generated/changelog.html b/docs/generated/changelog.html index 5c4b52267..b6b5ea480 100644 --- a/docs/generated/changelog.html +++ b/docs/generated/changelog.html @@ -12,6 +12,7 @@

Agent-JS Changelog

Version x.x.x

    +
  • feat: release automation changes
  • fix: distinguish remote dev environments from known hosts

Version 0.21.2