97 lines
3.4 KiB
Markdown
Raw Normal View History

2025-10-16 07:29:26 +02:00
# Release process
This document describes the release process for the Go bindings.
## Description
2025-10-16 07:32:03 +02:00
1. Ensure the main branch is up-to-date and all tests are passing.
2025-10-16 07:29:26 +02:00
2. Update the CHANGELOG.md with the description of the changes
3. Create a new tag, example:
```sh
git tag v0.0.15
git push --tags
```
4. The CI job will build the artifacts and create a draft release with the artifacts uploaded.
5. Copy the description added in the `CHANGELOG.md` file to the release description.
6. Publish it.
Once published, the artifacts can be downloaded using the `version`, example:
2025-12-24 16:44:53 +04:00
`https://github.com/logos-storage/logos-storage-go-bindings/releases/download/v0.0.16/storage-linux-amd64.zip`
2025-10-16 07:29:26 +02:00
It is not recommended to use the `latest` URL because you may face cache issues.
2025-10-13 11:27:25 +02:00
2025-11-04 06:31:14 +01:00
## Integration
Once released, you can integrate it into your Go project using:
```bash
2025-12-24 16:44:53 +04:00
go get github.com/logos-storage/logos-storage-go-bindings@v0.0.26
2025-11-04 06:31:14 +01:00
```
Then you can use the following `Makefile` command to fetch the artifact:
```bash
LIBS_DIR := $(abspath ./libs)
2025-12-24 16:44:53 +04:00
STORAGE_OS := linux
STORAGE_ARCH := amd64
STORAGE_VERSION := $(shell go list -m -f '{{.Version}}' github.com/logos-storage/logos-storage-go-bindings 2>/dev/null)
STORAGE_DOWNLOAD_URL := "https://github.com/logos-storage/logos-storage-go-bindings/releases/download/$(STORAGE_VERSION)/storage-${STORAGE_OS}-${STORAGE_ARCH}.zip"
2025-11-04 06:31:14 +01:00
2025-12-24 16:44:53 +04:00
fetch-libstorage:
2025-11-04 06:31:14 +01:00
mkdir -p $(LIBS_DIR); \
2025-12-24 16:44:53 +04:00
curl -fSL --create-dirs -o $(LIBS_DIR)/storage-${STORAGE_OS}-${STORAGE_ARCH}.zip ${STORAGE_DOWNLOAD_URL}; \
unzip -o -qq $(LIBS_DIR)/storage-${STORAGE_OS}-${STORAGE_ARCH}.zip -d $(LIBS_DIR); \
rm -f $(LIBS_DIR)/storage*.zip;
2025-11-04 06:31:14 +01:00
```
2025-12-24 16:44:53 +04:00
`STORAGE_VERSION` uses the same version as the Logos Storage Go dependency declared in your project.
2025-11-04 06:31:14 +01:00
### Nix
If you use Nix in a sandboxed environment, you cannot use curl to download the artifacts, so you have to prefetch them using the artifacts `SHA-256` hash. To generate the hash, you can use the following command:
```bash
2025-12-24 16:44:53 +04:00
nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-go-bindings/releases/download/v0.0.26/storage-macos-arm64.zip | jq -r .hash
2025-11-04 06:31:14 +01:00
# [10.4 MiB DL] sha256-3CHIWoSjo0plsYqzXQWm1EtY1STcljV4yfXTPon90uE=
```
Then include this hash in your Nix configuration. For example:
```nix
let
optionalString = pkgs.lib.optionalString;
2025-12-24 16:44:53 +04:00
storageVersion = "v0.0.26";
2025-11-04 06:31:14 +01:00
arch =
if stdenv.hostPlatform.isx86_64 then "amd64"
else if stdenv.hostPlatform.isAarch64 then "arm64"
else stdenv.hostPlatform.arch;
os = if stdenv.isDarwin then "macos" else "Linux";
hash =
if stdenv.hostPlatform.isDarwin
2025-12-24 16:44:53 +04:00
# nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-go-bindings/releases/download/v0.0.26/storage-macos-arm64.zip | jq -r .hash
2025-11-04 06:31:14 +01:00
then "sha256-3CHIWoSjo0plsYqzXQWm1EtY1STcljV4yfXTPon90uE="
2025-12-24 16:44:53 +04:00
# nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-go-bindings/releases/download/v0.0.26/storage-Linux-amd64.zip | jq -r .hash
2025-11-04 06:31:14 +01:00
else "sha256-YxW2vFZlcLrOx1PYgWW4MIstH/oFBRF0ooS0sl3v6ig=";
2025-12-24 16:44:53 +04:00
# Pre-fetch libstorage to avoid network during build
storageLib = pkgs.fetchzip {
url = "https://github.com/logos-storage/logos-storage-go-bindings/releases/download/${storageVersion}/storage-${os}-${arch}.zip";
2025-11-04 06:31:14 +01:00
hash = hash;
stripRoot = false;
};
preBuild = ''
2025-12-24 16:44:53 +04:00
export LIBS_DIR="${storageLib}"
# Build something cool with Logos Storage
2025-11-04 06:31:14 +01:00
'';
```