This document describes the release process for the Go bindings.
-
Ensure the main branch is up-to-date and all tests are passing.
-
Update the CHANGELOG.md with the description of the changes
-
Create a new tag, example:
git tag v0.0.15
git push --tags-
The CI job will build the artifacts and create a draft release with the artifacts uploaded.
-
Copy the description added in the
CHANGELOG.mdfile to the release description. -
Publish it.
Once published, the artifacts can be downloaded using the version, example:
https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-linux-amd64-v0.3.2.zip
It is not recommended to use the latest URL because you may face cache issues.
Once released, you can integrate it into your Go project using:
go get github.com/logos-storage/logos-storage-go-bindings@v0.0.26Then you can use the following Makefile command to fetch the artifact:
LIBS_DIR := $(abspath ./libs)
STORAGE_OS := linux
STORAGE_ARCH := amd64
STORAGE_VERSION := v0.3.2
STORAGE_DOWNLOAD_URL := "https://github.com/logos-storage/logos-storage-nim/releases/download/$(STORAGE_VERSION)/libstorage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VERSION}.zip"
fetch-libstorage:
mkdir -p $(LIBS_DIR); \
curl -fSL --create-dirs -o $(LIBS_DIR)/libstorage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VESION}.zip ${STORAGE_DOWNLOAD_URL}; \
unzip -o -qq $(LIBS_DIR)/libstorage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VESION}.zip -d $(LIBS_DIR); \
rm -f $(LIBS_DIR)/libstorage*.zip;STORAGE_VERSION is the release version from Logos Storage Nim.
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:
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
# sha256-YnMhmM0/JAmpdVref24n8l08UY7me0IQBbelIBfz2UE=Then include this hash in your Nix configuration. For example:
let
optionalString = pkgs.lib.optionalString;
storageVersion = "v0.0.26";
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
# 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
then "sha256-YnMhmM0/JAmpdVref24n8l08UY7me0IQBbelIBfz2UE=="
# 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
else "sha256-YDrT+MhXDMuKHwi1Dhg+uMg0vsC2PchlvX1Rb3HkRow=";
# Pre-fetch libstorage to avoid network during build
storageLib = pkgs.fetchzip {
url = "https://github.com/logos-storage/logos-storage-nim/releases/download/${storageVersion}/libstorage-${os}-${arch}-${storageVersion}.zip";
hash = hash;
stripRoot = false;
};
preBuild = ''
export LIBS_DIR="${storageLib}"
# Build something cool with Logos Storage
'';