Skip to content

NuGet パッケージの設定と、GitHub Actions のテスト・公開ワークフローを追加 - #12

Merged
cssho merged 4 commits into
masterfrom
nuget-ci
Nov 6, 2026
Merged

cssho merged 4 commits into
masterfrom
nuget-ci

Conversation

@cssho

@cssho cssho commented Nov 5, 2026

Copy link
Copy Markdown
Owner

概要

NuGet パッケージの設定と、GitHub Actions のワークフロー(テスト・パッケージ作成・nuget.org への公開)を追加しました。

パッケージ情報(Directory.Build.props)

  • 作成者・著作権を LICENSE と同じ cssho にそろえた(Copyright (c) 2015 cssho。1.x から引き継いでいた Toshiba の表記は削除)。
  • MIT ライセンス、リポジトリ URL、タグ、README の同梱、シンボルパッケージ(.snupkg)、Source Link。
  • パッケージ検証(EnablePackageValidation):net8.0 版から netstandard2.0 版の公開 API が欠けているとエラー(CP0002)になる。わざと API を欠けさせてエラーになることを確認済み。net8.0 版にだけ API を足す変更は検出しない。

作成されるパッケージ:

パッケージ 対象 依存
ZipConvertCustomerBarCode netstandard2.0、net8.0 なし
ZipConvertCustomerBarCode.Drawing netstandard2.0 コア、System.Drawing.Common
ZipConvertCustomerBarCode.SkiaSharp netstandard2.0 コア、SkiaSharp

ワークフロー(.github/workflows/build.yml)

ジョブ 動くとき 内容
test push(master・タグ)、PR Ubuntu と Windows × コアの両方のビルド(net8.0 / netstandard2.0)の 4 通りでテスト
pack test の後 パッケージを作成して成果物として保存。タグ以外は 0.0.0-ci.番号
publish v* タグの push のみ release Environment で承認後、Trusted Publishing で一時的な API キーを取得し、タグのバージョンで公開
  • release Environment は作成済み(v* タグのみ、cssho の承認が必須)。
  • Linux で SkiaSharp のテストを動かすため、テストプロジェクトにだけ SkiaSharp.NativeAssets.Linux.NoDependencies を追加した。

公開前に必要な設定

  • nuget.org の Trusted Publishing ポリシー(Owner cssho、Repository ZipConvertCustomerBarCode、Workflow File build.yml、Environment release、対象は 3 パッケージ名)。
  • release Environment の Secret NUGET_USER(nuget.org のユーザー名)。

確認

  • 手元で両方のビルドのテスト 238 件がすべて成功し、3 パッケージを警告なしで作成できた。
  • ワークフロー(YAML・Linux でのテスト)は、この PR で初めて動く。

🤖 Generated with Claude Code

https://claude.ai/code/session_01HNb8H3ydQTR8dWU8d28osE

cssho and others added 4 commits November 6, 2026 08:42
- パッケージ情報(作成者・著作権を cssho にそろえる、MIT、README・シンボル・Source Link)を設定
- パッケージ作成時に net8.0 版から netstandard2.0 版の公開 API が欠けていないかを検証する
- push・PR で Ubuntu と Windows × コアの両方のビルドをテストし、パッケージを作る
- v* タグの push で、release Environment(承認後)から Trusted Publishing で nuget.org に公開する
- Linux で SkiaSharp のテストを動かすため、テストプロジェクトにネイティブライブラリを追加
- README にインストール方法、CLAUDE.md にリリース手順を追記

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HNb8H3ydQTR8dWU8d28osE
actions/checkout@v4・actions/setup-dotnet@v4 が廃止予定の Node.js 20 で動いている警告が出ていたため、
checkout@v7、setup-dotnet@v6、upload-artifact@v7、download-artifact@v8 に更新した。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HNb8H3ydQTR8dWU8d28osE
- gh actions-lock で .github/workflows/actions.lock を作成し、ワークフローのアクションを正確なタグとコミットに固定した
- ロックファイルを PR・push・週1回で検証する verify-lockfile.yml を追加
- アクションの更新を Dependabot で行い、リリースから7日待つ(cooldown)ようにした
- CLAUDE.md にロックファイルの手順を追記

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HNb8H3ydQTR8dWU8d28osE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HNb8H3ydQTR8dWU8d28osE
@cssho
cssho merged commit 887c5c8 into master Nov 6, 2026
8 checks passed
@cssho
cssho deleted the nuget-ci branch November 6, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant