diff options
| author | 2023-01-16 11:58:57 -0800 | |
|---|---|---|
| committer | 2023-01-16 11:58:57 -0800 | |
| commit | b0702ce7b156f9dbeb3f4f65fe94b12044e28334 (patch) | |
| tree | ea34b54a3ba19f00406adbb5bfcb3280e87f4842 | |
| parent | ff3f5aa154fd4ee390c87733b6ed61d68a750c33 (diff) | |
| download | bun-b0702ce7b156f9dbeb3f4f65fe94b12044e28334.tar.gz bun-b0702ce7b156f9dbeb3f4f65fe94b12044e28334.tar.zst bun-b0702ce7b156f9dbeb3f4f65fe94b12044e28334.zip | |
Publish bun-types@canary (#1767)
* Publish bun-types@canary
* Get version from bun cli
* Get version from bun cli
* Fixes
* Fixes
* Fixes
* Finalize
* Update names
* Add token
* Remove dryrun
* Switch setup-bun
* Test noncanary publish
* Fix path for GPR
* Use latest
* Remove testing code
* Remove dry run
* Fix paths
* Update bun-types links
* Verbose logging
* Ignore lockfile
* Run install in root
* Remove debug code
* Remove debug code
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
| -rw-r--r-- | .github/workflows/bun-types-release-canary.yml | 58 | ||||
| -rw-r--r-- | .github/workflows/bun-types-release.yml | 24 | ||||
| -rw-r--r-- | .github/workflows/bun-types-tests.yml | 15 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | packages/bun-types/package.json | 2 | ||||
| -rw-r--r-- | packages/bun-types/scripts/bundle.ts | 2 |
6 files changed, 78 insertions, 25 deletions
diff --git a/.github/workflows/bun-types-release-canary.yml b/.github/workflows/bun-types-release-canary.yml new file mode 100644 index 000000000..f3d95aaa2 --- /dev/null +++ b/.github/workflows/bun-types-release-canary.yml @@ -0,0 +1,58 @@ +name: Release bun-types@canary +on: + push: + branches: [main] +jobs: + tests: + name: Build, test, publish canary + runs-on: ubuntu-latest + if: github.repository_owner == 'oven-sh' + defaults: + run: + working-directory: packages/bun-types + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version: latest + + - name: Install Bun + uses: oven-sh/setup-bun@v0.1.8 + with: + bun-version: latest + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install dependencies + run: bun install + + - name: Generate package + run: bun run build + + - name: Tests + run: bun run test + + - name: Set temp version + working-directory: packages/bun-types/dist + run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") + new_pkg_version="$(bun --version)-canary.${git_hash}" + echo "new_pkg_version" + echo "${new_pkg_version}" + npm version ${new_pkg_version} --no-git-tag-version + - name: Publish to NPM + uses: JS-DevTools/npm-publish@v1 + with: + package: packages/bun-types/dist/package.json + token: ${{ secrets.NPM_BUN_TYPES_TOKEN }} + # dry-run: true + tag: canary + + # - name: Publish on NPM + # working-directory: packages/bun-types/dist + # run: npm publish --access public --tag canary # --dry-run + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # NODE_AUTH_TOKEN: ${{ secrets.NPM_BUN_TYPES_TOKEN }}
\ No newline at end of file diff --git a/.github/workflows/bun-types-release.yml b/.github/workflows/bun-types-release.yml index ca8058967..2a83b0bcf 100644 --- a/.github/workflows/bun-types-release.yml +++ b/.github/workflows/bun-types-release.yml @@ -1,4 +1,4 @@ -name: Release +name: Release bun-types on: workflow_dispatch: @@ -14,9 +14,9 @@ jobs: - uses: actions/checkout@v3 - name: Install bun - uses: xhyrom/setup-bun@v0.1.8 + uses: oven-sh/setup-bun@v0.1.8 with: - bun-version: canary + bun-version: latest github-token: ${{ secrets.GITHUB_TOKEN }} - name: Install node @@ -27,9 +27,6 @@ jobs: - name: Install dependencies run: bun install - - name: ESLint - run: bun run lint - - name: Build package run: bun run build @@ -41,7 +38,7 @@ jobs: if-no-files-found: error publish-npm: - name: Publish on NPM + name: Publish to NPM runs-on: ubuntu-latest needs: [test-build] if: github.repository_owner == 'oven-sh' @@ -51,7 +48,7 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install node + - name: Install Node uses: actions/setup-node@v3 with: node-version: latest @@ -63,8 +60,9 @@ jobs: name: bun-types path: packages/bun-types/dist - - name: Publish on NPM - run: cd packages/bun-types/dist/ && npm publish --access public + - name: Publish to NPM + working-directory: packages/bun-types/dist + run: npm publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -88,16 +86,16 @@ jobs: scope: '@oven-sh' - name: Install bun - uses: xhyrom/setup-bun@v0.1.8 + uses: oven-sh/setup-bun@v0.1.8 with: - bun-version: canary + bun-version: latest github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download all artifacts uses: actions/download-artifact@v3 with: name: bun-types - path: dist + path: packages/bun-types/dist - name: Add scope to name run: bun scripts/gpr.ts diff --git a/.github/workflows/bun-types-tests.yml b/.github/workflows/bun-types-tests.yml index a0aca829f..5c961139b 100644 --- a/.github/workflows/bun-types-tests.yml +++ b/.github/workflows/bun-types-tests.yml @@ -1,16 +1,16 @@ -name: TypeScript Types +name: Test bun-types on: push: paths: - - packages/bun-types/**/* + - 'packages/bun-types/**' branches: [main] pull_request: paths: - - packages/bun-types/**/* + - 'packages/bun-types/**' jobs: tests: - name: Build and Test + name: Build and test runs-on: ubuntu-latest defaults: run: @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install bun - uses: xhyrom/setup-bun@v0.1.8 + uses: oven-sh/setup-bun@v0.1.8 with: bun-version: latest github-token: ${{ secrets.GITHUB_TOKEN }} @@ -37,8 +37,5 @@ jobs: - name: Generate package run: bun run build - - name: ESLint - run: bun run lint - - name: Tests run: bun run test @@ -2591,7 +2591,7 @@ If you need to read from `stdout` or `stderr` synchronously, you should use `Bun `Bun.spawn` returns a `Subprocess` object. -More complete types are available in [`bun-types`](https://github.com/oven-sh/bun-types). +More complete types are available in [`bun-types`](https://github.com/oven-sh/bun/tree/main/packages/bun-types). ```ts interface Subprocess { diff --git a/packages/bun-types/package.json b/packages/bun-types/package.json index b7eea6ea5..ada826752 100644 --- a/packages/bun-types/package.json +++ b/packages/bun-types/package.json @@ -2,7 +2,7 @@ "name": "bun-types", "types": "index.d.ts", "private": true, - "repository": "https://github.com/oven-sh/bun-types", + "repository": "https://github.com/oven-sh/bun", "scripts": { "build": "rm -rf ./dist && bun run bundle && bun run fmt", "bundle": "bun scripts/bundle.ts ./dist", diff --git a/packages/bun-types/scripts/bundle.ts b/packages/bun-types/scripts/bundle.ts index 9733352e6..7661a8747 100644 --- a/packages/bun-types/scripts/bundle.ts +++ b/packages/bun-types/scripts/bundle.ts @@ -53,7 +53,7 @@ const packageJSON = { files: ["types.d.ts", "README.md"], private: false, keywords: ["bun", "bun.js", "types"], - repository: "https://github.com/oven-sh/bun-types", + repository: "https://github.com/oven-sh/bun", homepage: "https://bun.sh", }; |
