From afe2652839db159a0ce4cf2f15d7fe18a8b4ba63 Mon Sep 17 00:00:00 2001 From: buty4649 Date: Mon, 20 Apr 2026 14:59:03 +0900 Subject: [PATCH 1/2] =?UTF-8?q?release:=20=E3=83=AA=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E6=88=90=E6=9E=9C=E7=89=A9=E3=81=AB=20winget=20manife?= =?UTF-8?q?st=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit goreleaser の post-build hook で windows/amd64 バイナリから sha256 を計算し winget-manifest.yaml を生成、release.extra_files でリリース資産に含める。 Co-Authored-By: Claude Opus 4.7 --- .goreleaser.yml | 7 +++++++ scripts/gen-winget-manifest.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 scripts/gen-winget-manifest.sh diff --git a/.goreleaser.yml b/.goreleaser.yml index 4893946..ee6ac0e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -31,6 +31,11 @@ builds: goarch: amd64 - goos: windows goarch: arm64 + hooks: + post: + - cmd: ./scripts/gen-winget-manifest.sh "{{ .Path }}" "{{ .Version }}" + env: + - TARGET={{ .Os }}_{{ .Arch }} archives: - formats: [binary] @@ -53,3 +58,5 @@ changelog: release: draft: false prerelease: auto + extra_files: + - glob: ./dist/winget-manifest.yaml diff --git a/scripts/gen-winget-manifest.sh b/scripts/gen-winget-manifest.sh new file mode 100755 index 0000000..df7f5e3 --- /dev/null +++ b/scripts/gen-winget-manifest.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ "${TARGET:-}" != "windows_amd64" ]]; then + exit 0 +fi + +binary_path="${1:?binary path required}" +version="${2:?version required}" +output="${3:-dist/winget-manifest.yaml}" + +checksum=$(sha256sum "$binary_path" | awk '{print $1}') + +mkdir -p "$(dirname "$output")" + +cat > "$output" < Date: Mon, 20 Apr 2026 15:06:46 +0900 Subject: [PATCH 2/2] =?UTF-8?q?document:=20README=20=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E6=89=8B=E9=A0=86?= =?UTF-8?q?=E3=82=92=20OS=20=E5=88=A5=E3=81=AB=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux/macOS は gh もしくは mise、Windows は winget-manifest 経由でのインストール手順を案内する。 Co-Authored-By: Claude Opus 4.7 --- README.md | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c847287..5aecc92 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,44 @@ ## インストール -Go 1.26 以降: +### Linux / macOS + +[gh](https://cli.github.com/) コマンドを使って最新リリースからバイナリを取得: + +```sh +mkdir -p ~/.local/bin + +# Linux (amd64) +gh release download --repo pepabo/xpoint-cli --pattern '*_linux_amd64' -O xp +chmod +x xp && mv xp ~/.local/bin/ + +# macOS (arm64) +gh release download --repo pepabo/xpoint-cli --pattern '*_darwin_arm64' -O xp +chmod +x xp && xattr -d com.apple.quarantine xp && mv xp ~/.local/bin/ +``` + +[mise](https://mise.jdx.dev/) を使う場合: ```sh -go install github.com/pepabo/xpoint-cli@latest +mise use -g github:pepabo/xpoint-cli@latest ``` -または [GitHub Releases](https://github.com/pepabo/xpoint-cli/releases) からバイナリを取得。 +### Windows + +PowerShell で最新リリースの `winget-manifest.yaml` をダウンロードし、`winget install --manifest` でインストール: + +```powershell +Invoke-WebRequest -Uri https://github.com/pepabo/xpoint-cli/releases/latest/download/winget-manifest.yaml -OutFile winget-manifest.yaml +winget install --manifest winget-manifest.yaml +``` + +> [!NOTE] +> `--manifest` を使うには `winget settings` でローカルマニフェストを有効化する必要があります。 +> 管理者権限の PowerShell で `winget settings --enable LocalManifestFiles` を実行してください。 + +### バイナリを直接ダウンロード + +[GitHub Releases](https://github.com/pepabo/xpoint-cli/releases) から対応するバイナリを取得してください。 ## 認証