-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[#11] Add autorelease script
- Loading branch information
Showing
5 changed files
with
63 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# SPDX-FileCopyrightText: 2019 TQ Tezos <https://tqtezos.com/> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
{ pkgs ? import <nixpkgs> { }, timestamp ? "19700101" }: | ||
let closures = builtins.attrValues (import ./. { inherit pkgs timestamp; }); | ||
in pkgs.runCommandNoCC "release" { inherit closures; } '' | ||
mkdir -p $out | ||
for closure in $closures; do | ||
cp $closure/* $out/ | ||
done | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -p gitAndTools.hub git -i bash | ||
# SPDX-FileCopyrightText: 2019 TQ Tezos <https://tqtezos.com/> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
# Project name, inferred from repository name | ||
project=$(basename $(pwd)) | ||
|
||
# The directory in which artifacts will be created | ||
TEMPDIR=`mktemp -d` | ||
|
||
# Build release.nix | ||
nix-build release.nix -o $TEMPDIR/$project --arg timestamp $(date +\"%Y%m%d%H%M\") | ||
|
||
# Delete release | ||
hub release delete auto-release | ||
|
||
# Update the tag | ||
git fetch # So that the script can be run from an arbitrary checkout | ||
git tag -f auto-release | ||
git push --force --tags | ||
|
||
# Combine all assets | ||
assets="" | ||
for file in $TEMPDIR/$project/*; do | ||
assets+="-a $file " | ||
done | ||
|
||
# Create release | ||
hub release create $assets -m "Automatic build on $(date -I)" --prerelease auto-release |