parent
e9190e4dbb
commit
3a3bd56295
@ -0,0 +1,32 @@ |
||||
# Releases |
||||
|
||||
A release consists of: |
||||
|
||||
- A full set of binaries for all supported platforms, compiled from the same |
||||
source. |
||||
- A text file containing hashes of each binary. |
||||
- A file containing a signature of the hash file, created by whoever is building |
||||
the release. |
||||
|
||||
## Building |
||||
|
||||
*NOTE: This has only been tested from an x86_64 linux machine* |
||||
|
||||
To create a release only a functional nix installation is required. Simply run |
||||
the `./release.sh` script, and input a release name when prompted. |
||||
|
||||
From here a cryptic-net binary will be cross-compiled for all supported |
||||
platforms. This will take a long time the first time you perform it on your |
||||
machine. |
||||
|
||||
Once compilation is completely, the release will be signed using the default GPG |
||||
key on your machine, and you will be prompted for its password in order to |
||||
create the signature. |
||||
|
||||
## Releasing |
||||
|
||||
Releases are uploaded to the repository's Releases page, and release naming |
||||
follows the conventional semantic versioning system. Each release should be |
||||
accompanied by a set of changes which have occurred since the last release, |
||||
described both in the `CHANGELOG.md` file and in the description on the Release |
||||
itself. |
@ -0,0 +1,50 @@ |
||||
{ |
||||
releaseName, |
||||
|
||||
buildSystem ? builtins.currentSystem, |
||||
pkgsNix ? (import ./nix/pkgs.nix), |
||||
supportedSystems ? pkgsNix.supportedSystems, |
||||
|
||||
}: let |
||||
|
||||
pkgs = pkgsNix.default { inherit buildSystem; }; |
||||
|
||||
mkRelease = hostSystem: let |
||||
|
||||
appImage = ((import ./default.nix) { |
||||
inherit buildSystem hostSystem releaseName; |
||||
}).appImage; |
||||
|
||||
in pkgs.stdenv.mkDerivation { |
||||
name = "cryptic-net-release-${hostSystem}"; |
||||
inherit releaseName appImage hostSystem; |
||||
|
||||
builder = builtins.toFile "build.sh" '' |
||||
source $stdenv/setup |
||||
|
||||
mkdir -p "$out"/ |
||||
cp "$appImage"/bin/cryptic-net "$out"/cryptic-net-$releaseName-$hostSystem |
||||
''; |
||||
}; |
||||
|
||||
releases = builtins.map mkRelease supportedSystems; |
||||
|
||||
in |
||||
|
||||
pkgs.stdenv.mkDerivation { |
||||
name = "cryptic-net-release-${releaseName}"; |
||||
inherit releases; |
||||
|
||||
nativeBuildInputs = [ pkgs.coreutils ]; |
||||
|
||||
builder = builtins.toFile "build.sh" '' |
||||
source $stdenv/setup |
||||
|
||||
mkdir -p "$out" |
||||
for p in $releases; do |
||||
cp "$p"/cryptic-net-* "$out"/ |
||||
done |
||||
|
||||
(cd "$out" && sha256sum * > sha256.txt) |
||||
''; |
||||
} |
@ -0,0 +1,34 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
set -e |
||||
|
||||
scriptDir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P) |
||||
cd "$scriptDir" |
||||
|
||||
printf "Release name (e.g. \"v0.1.2\"): " |
||||
read -r releaseName |
||||
|
||||
releasesDir="$(pwd)/releases" |
||||
mkdir -p "$releasesDir" |
||||
echo '*' > "$releasesDir"/.gitignore |
||||
|
||||
out="$releasesDir/$releaseName" |
||||
|
||||
if [ -e "$out" ]; then |
||||
echo "$out already exists, aborting" |
||||
exit 1 |
||||
fi |
||||
|
||||
result=$(nix-build \ |
||||
--argstr releaseName "$releaseName" \ |
||||
--no-out-link \ |
||||
release.nix \ |
||||
) |
||||
|
||||
cp -rL "$result" "$out" |
||||
chmod u+w -R "$out" |
||||
|
||||
cd "$out" |
||||
gpg -a --detach-sign -o sha256.txt.gpg ./sha256.txt |
||||
|
||||
echo "Release successfully created: $out" |
Loading…
Reference in new issue