Skip to content

Commit

Permalink
chore: generate checksum files after signing assets by codesign (#1105)
Browse files Browse the repository at this point in the history
* chore: calculate checksums after signing assets by codesign

This commit fixes checksums of assets for macOS.

From colima v0.7.1, assets for macOS are signed by codesign.

- 3415501
- #1094

But due to this checksums became invalid.

```console
$ gh release download abiosoft/colima v0.7.1

$ cat *.sha256sum
9db4f5617eb3a16ef4abca4d515a7e81b80f7f8646a8c3fe50e4eb6e6e1a8ccb *colima-Darwin-arm64
e136336f3b000fda729f4266d1af573dcf3378568d4c5433c6b63350f960f296 *colima-Darwin-x86_64
f866550da41a4d1df7437fbf2e42449e213281ac1784d2f4d905e7bd13c5c772 *colima-Linux-aarch64
95cdef8ffc9fa2620a9a4c0771c4eab727b5d654341a0b6fcc70842c2bc38486 *colima-Linux-x86_64

$ sha256sum colima-Darwin-arm64 colima-Darwin-x86_64 colima-Linux-aarch64 colima-Linux-x86_64
df99434b42f0f85da5fa86063f86d7e818a19fcb46da528fe4201d9f6356744e  colima-Darwin-arm64
abdf3069c8e6d35b1b23730cb320729eb53800b1049a4973f550e1ee4f62fa99  colima-Darwin-x86_64
f866550da41a4d1df7437fbf2e42449e213281ac1784d2f4d905e7bd13c5c772  colima-Linux-aarch64
95cdef8ffc9fa2620a9a4c0771c4eab727b5d654341a0b6fcc70842c2bc38486  colima-Linux-x86_64
```

codesign changed assets, so we need to generate checksum files after running codesign.

* ci: move the if statement
  • Loading branch information
suzuki-shunsuke authored Aug 13, 2024
1 parent ec7ca8e commit cf86fa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ fmt:
.PHONY: build
build:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags="$(LDFLAGS)" -o $(OUTPUT_DIR)/$(OUTPUT_BIN) ./cmd/colima
cd $(OUTPUT_DIR) && openssl sha256 -r -out $(OUTPUT_BIN).sha256sum $(OUTPUT_BIN)
ifeq ($(GOOS),darwin)
codesign -s - $(OUTPUT_DIR)/$(OUTPUT_BIN)
endif
cd $(OUTPUT_DIR) && openssl sha256 -r -out $(OUTPUT_BIN).sha256sum $(OUTPUT_BIN)

.PHONY: test
test:
Expand Down

0 comments on commit cf86fa9

Please sign in to comment.