diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 312c594..54bd8b9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,21 +11,43 @@ jobs: release: name: Release runs-on: ubuntu-latest + permissions: + contents: read + id-token: write steps: + - uses: navikt/github-app-token-generator@v1 + id: get-token + with: + private-key: ${{ secrets.APP_PRIVATE_KEY }} + app-id: ${{ secrets.APP_ID }} - name: Checkout Repo uses: actions/checkout@v3 - - name: Setup Node.js 20 + - name: Setup Node.js 22 uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 22 - uses: pnpm/action-setup@v4 - name: Install Dependencies run: pnpm install - - name: Create Release Pull Request + - name: Build Packages + run: pnpm build + + - name: publint + run: pnpm lint:publint + + - name: Create Release Pull Request or Publish to npm + id: changesets uses: changesets/action@v1 + with: + version: pnpm changeset version + publish: pnpm run publish + commit: "ci: release" + title: "ci: release" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.get-token.outputs.token }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: true diff --git a/package.json b/package.json index debe4b5..3847d9a 100644 --- a/package.json +++ b/package.json @@ -1,63 +1,64 @@ { - "name": "cdn-cache-control", - "version": "1.2.0", - "description": "Easy, opinionated CDN cache header handling", - "homepage": "https://github.com/ascorbic/cdn-cache-control", - "repository": "ascorbic/cdn-cache-control", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "files": [ - "dist", - "src" - ], - "exports": { - ".": { - "deno": "./src/index.ts", - "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - }, - "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" - } - } - }, - "tsup": { - "entry": [ - "src/index.ts" - ], - "splitting": false, - "sourcemap": true, - "clean": true, - "dts": true, - "format": [ - "esm", - "cjs" - ] - }, - "scripts": { - "build": "tsup", - "lint:types": "attw --pack .", - "lint:package": "publint", - "lint:prettier": "prettier --check src", - "lint": "pnpm run '/^lint:.*/'", - "test": "pnpm build && node --test", - "tsdoc": "tsdoc --src=src/index.ts && prettier --write README.md" - }, - "keywords": [], - "author": "Matt Kane ", - "license": "MIT", - "devDependencies": { - "@arethetypeswrong/cli": "^0.15.3", - "@changesets/cli": "^2.27.7", - "@types/node": "^20.14.2", - "prettier": "^3.3.1", - "publint": "^0.2.8", - "tsdoc-markdown": "^0.6.0", - "tsup": "^8.1.0", - "typescript": "^5.5.3" - }, - "packageManager": "pnpm@8.14.0+sha1.bb42032ff80dba5f9245bc1b03470d2fa0b7fb2f" + "name": "cdn-cache-control", + "version": "1.2.0", + "description": "Easy, opinionated CDN cache header handling", + "homepage": "https://github.com/ascorbic/cdn-cache-control", + "repository": "ascorbic/cdn-cache-control", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "files": [ + "dist", + "src" + ], + "exports": { + ".": { + "deno": "./src/index.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "tsup": { + "entry": [ + "src/index.ts" + ], + "splitting": false, + "sourcemap": true, + "clean": true, + "dts": true, + "format": [ + "esm", + "cjs" + ] + }, + "scripts": { + "build": "tsup", + "lint:types": "attw --pack .", + "lint:package": "publint", + "lint:prettier": "prettier --check src", + "publish": "changeset publish && npx jsr publish", + "lint": "pnpm run '/^lint:.*/'", + "test": "pnpm build && node --test", + "tsdoc": "tsdoc --src=src/index.ts && prettier --write README.md" + }, + "keywords": [], + "author": "Matt Kane ", + "license": "MIT", + "devDependencies": { + "@arethetypeswrong/cli": "^0.15.3", + "@changesets/cli": "^2.27.7", + "@types/node": "^20.14.2", + "prettier": "^3.3.1", + "publint": "^0.2.8", + "tsdoc-markdown": "^0.6.0", + "tsup": "^8.1.0", + "typescript": "^5.5.3" + }, + "packageManager": "pnpm@8.14.0+sha1.bb42032ff80dba5f9245bc1b03470d2fa0b7fb2f" } \ No newline at end of file