Deno社が始めた新しいレジストリ『JSR』にパッケージを公開してみる。
自動でバージョニングはされないため、できるだけ自動で更新されるように工夫をする。
- 初期プロジェクトを立ち上げてJSRに公開する
- deno.jsonのバージョンを更新せずに関数を追加して公開されないことを確認する
- deno.jsonのバージョンを更新して関数を追加して公開されることを確認する
- パッケージのバージョンとGit Tagのバージョンを連動させる
- GitHub Releaseを自動で追加する
- JSRでサブパッケージが公開できるか試す
- JSRのlintが効かない問題を解決する
- importがエラーになる問題を解決する
- Squash mergeと
npm:changesets/cli
を使って、PR単位で機能をまとめたリリースができるか試す - リリーススクリプトを調整して、コマンドを叩いたらPRが作成されるように修正
jobs.<job_name>.permissions.contents
がwrite
になっていなかった
changesets init
は動作したが、changesets version
が以下のエラーが出て動作しない
$ deno run npm:@changesets/[email protected] version
✅ Granted all env access.
✅ Granted all read access.
✅ Granted all sys access.
🦋 error Error: No package.json could be found upwards from the directory /home/windchime-yk/dev/playground/learn-jsr
🦋 error at _callee4$ (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/@manypkg/find-root/1.1.0/dist/find-root.cjs.dev.js:217:19)
🦋 error at tryCatch (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/@babel/runtime/7.26.7/helpers/regeneratorRuntime.js:45:16)
🦋 error at Generator.<anonymous> (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/@babel/runtime/7.26.7/helpers/regeneratorRuntime.js:133:17)
🦋 error at Generator.next (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/@babel/runtime/7.26.7/helpers/regeneratorRuntime.js:74:21)
🦋 error at asyncGeneratorStep (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/@babel/runtime/7.26.7/helpers/asyncToGenerator.js:3:17)
🦋 error at _next (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/@babel/runtime/7.26.7/helpers/asyncToGenerator.js:17:9)
🦋 error at eventLoopTick (ext:core/01_core.js:177:7) {
🦋 error directory: '/home/windchime-yk/dev/playground/learn-jsr'
🦋 error }
これは書いてあるとおり、今のプロジェクトにpackage.json
が存在しないためエラーになっている
実際のところ、Denoはpackage.json
もカバーしているので利用可能かもしれないが、私個人がdeno.jsonc
でやっていきたいためchangesetsは使わない方針とする
changesetsのDeno対応は開発リソースの都合でメンテナは着手しづらい状況になっているようで、コミュニティ側が対応しない限りは難しいと考えられる
changesets/changesets#824
Deno公式は、標準ライブラリのリリースに自前のリリースライブラリである@deno/bump-workspaces
を使っている
Freshはリポジトリを見る限りでは手動な模様
- @whyk/greetingの公開方法案内ページ
- GitHub Actionsでの公開方法案内
- GitHub Actions: Deprecating save-state and set-output commands - The GitHub Blog
- エラー: 403 "統合によってリソースにアクセスできません" - GitHub Docs
- Github ActionsでResource not accessible by integrationが出た際の対処法
- GITHUB_TOKEN のアクセス許可の変更 - 自動トークン認証 - GitHub Docs
- permissions - GitHub Actionsのワークフロー構文 - GitHub Docs
- Github Actionsを使ってgit commitとgit pushを自動化しよう。 - ポンコツエンジニアのごじゃっぺ開発日記。
- Use target-version in a file, then create the tag of both · Issue #204 · mathieudutour/github-tag-action
- Mark this repository as unmaintained · Issue #119 · actions/create-release
- Github Actions の workflow run について
- ワークフローの再利用 - GitHub Docs
- [github actions] Reusable workflowsが実装されたのでざっとまとめ
- changesetsを使ってWebサイトのバージョン管理を自動化する