From 1e7ba60158526555fd891aa9ed5e5866aac6f670 Mon Sep 17 00:00:00 2001 From: Patrick Bacon-Blaber Date: Mon, 4 May 2026 20:02:38 -0400 Subject: [PATCH] fix: use trusted publishing for npm releases --- .github/workflows/release.yaml | 12 ++++++++---- bin/ott.js | 3 +++ package.json | 7 ++++--- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100755 bin/ott.js diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2e171f4..dc63b0f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,7 @@ on: permissions: contents: write + id-token: write pull-requests: write jobs: @@ -24,6 +25,8 @@ jobs: uses: actions/setup-node@v6 with: node-version-file: .nvmrc + registry-url: https://registry.npmjs.org + package-manager-cache: false - name: Install Dependencies if: ${{ steps.publish.outputs.release_created }} @@ -33,9 +36,10 @@ jobs: if: ${{ steps.publish.outputs.release_created }} run: npm run build + - name: Run Tests + if: ${{ steps.publish.outputs.release_created }} + run: npm test + - name: Publish to NPM if: ${{ steps.publish.outputs.release_created }} - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc && npm publish - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - \ No newline at end of file + run: npm publish diff --git a/bin/ott.js b/bin/ott.js new file mode 100755 index 0000000..3902597 --- /dev/null +++ b/bin/ott.js @@ -0,0 +1,3 @@ +#! /usr/bin/env node + +require('../dist/main.js'); diff --git a/package.json b/package.json index 78ccdf7..a5ba4a6 100644 --- a/package.json +++ b/package.json @@ -17,15 +17,16 @@ ], "main": "./dist/main.js", "bin": { - "ott": "./dist/main.js" + "ott": "bin/ott.js" }, "files": [ + "bin", "dist", "CHANGELOG.md" ], "repository": { "type": "git", - "url": "https://github.com/pablaber/openapi-typescript-types/" + "url": "git+https://github.com/pablaber/openapi-typescript-types.git" }, "scripts": { "build": "tsc", @@ -53,4 +54,4 @@ "minimatch": "^9.0.4", "winston": "^3.13.0" } -} \ No newline at end of file +}