-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further automate publishing of undici-types using GitHub Actions work…
…flow (#2290) * add workflow * improve automation * linting
- Loading branch information
1 parent
5a75005
commit 4024468
Showing
5 changed files
with
44 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm ci | ||
- run: node scripts/generate-undici-types-package-json.js | ||
- run: cd types | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const fs = require('node:fs') | ||
const path = require('node:path') | ||
|
||
const packageJSONPath = path.join(__dirname, '..', 'package.json') | ||
const packageJSONRaw = fs.readFileSync(packageJSONPath, 'utf-8') | ||
const packageJSON = JSON.parse(packageJSONRaw) | ||
|
||
const packageTypesJSON = { | ||
name: 'undici-types', | ||
version: packageJSON.version, | ||
description: 'A stand-alone types package for Undici', | ||
homepage: packageJSON.homepage, | ||
bugs: packageJSON.bugs, | ||
repository: packageJSON.repository, | ||
license: packageJSON.license, | ||
types: 'index.d.ts', | ||
files: ['*.d.ts'], | ||
contributors: packageJSON.contributors | ||
} | ||
|
||
const packageTypesPath = path.join(__dirname, '..', 'types', 'package.json') | ||
|
||
fs.writeFileSync(packageTypesPath, JSON.stringify(packageTypesJSON, null, 2)) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.