97 lines
3.3 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:
2026-03-06 10:44:57 +04:00
`https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-linux-amd64-v0.3.2.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
2026-03-06 10:44:57 +04:00
STORAGE_VERSION := v0.3.2
2026-03-06 10:47:46 +04:00
STORAGE_DOWNLOAD_URL := "https://github.com/logos-storage/logos-storage-nim/releases/download/$(STORAGE_VERSION)/libstorage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VERSION}.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); \
2026-03-06 10:46:33 +04:00
curl -fSL --create-dirs -o $(LIBS_DIR)/libstorage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VESION}.zip ${STORAGE_DOWNLOAD_URL}; \
2026-03-06 10:44:57 +04:00
unzip -o -qq $(LIBS_DIR)/libstorage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VESION}.zip -d $(LIBS_DIR); \
rm -f $(LIBS_DIR)/libstorage*.zip;
2025-11-04 06:31:14 +01:00
```
2026-03-06 10:44:57 +04:00
`STORAGE_VERSION` is the release version from Logos Storage Nim.
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
2026-03-06 10:44:57 +04:00
nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-darwin-arm64-v0.3.2.zip | jq -r .hash
2025-11-04 06:31:14 +01:00
2026-03-17 11:18:45 +04:00
# sha256-YnMhmM0/JAmpdVref24n8l08UY7me0IQBbelIBfz2UE=
2025-11-04 06:31:14 +01:00
```
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
2026-03-06 10:44:57 +04:00
# nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-darwin-arm64-v0.3.2.zip | jq -r .hash
2026-03-17 21:35:18 +11:00
then "sha256-YnMhmM0/JAmpdVref24n8l08UY7me0IQBbelIBfz2UE=="
2026-03-06 10:44:57 +04:00
# nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-linux-amd64-v0.3.2.zip | jq -r .hash
2026-03-17 21:35:18 +11:00
else "sha256-YDrT+MhXDMuKHwi1Dhg+uMg0vsC2PchlvX1Rb3HkRow=";
2025-11-04 06:31:14 +01:00
2025-12-24 16:44:53 +04:00
# Pre-fetch libstorage to avoid network during build
storageLib = pkgs.fetchzip {
2026-03-06 10:47:46 +04:00
url = "https://github.com/logos-storage/logos-storage-nim/releases/download/${storageVersion}/libstorage-${os}-${arch}-${storageVersion}.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
'';
```