Created
June 15, 2017 13:38
-
-
Save Cloudef/b86495ecccd2b8aa6fca542a4d82c136 to your computer and use it in GitHub Desktop.
wlc release scripts
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
#!/bin/bash | |
# Archive git project including all submodules | |
# Usage: git archive-all <name> <ref> | |
set -eEuo pipefail | |
current="$(git rev-parse --abbrev-ref HEAD)" | |
toplevel="$(git rev-parse --show-toplevel)" | |
toplevel="${toplevel##*/}" | |
name="${1:-$toplevel}" | |
git checkout -q "${2:-HEAD}" | |
git submodule update -q --init --recursive | |
git archive --prefix "$name/" --format tar -o root.tar HEAD | |
git submodule foreach -q --recursive 'git archive --prefix="'"$name"'/$path/" --format tar -o "$sha1.tar" HEAD; tar -Af "$toplevel/root.tar" "$sha1.tar"; rm "$sha1.tar"' | |
bzip2 root.tar | |
mv root.tar.bz2 "$name.tar.bz2" | |
git checkout -q "$current" | |
git submodule update -q --init --recursive | |
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
#!/bin/sh | |
# Usage: ./make_release.sh new-tag-name | |
set -e | |
[ "$@" ] || { printf "missing release name\n" 1>&2; exit 1; } | |
git tag -s v"$@" | |
git archive-all wlc-"$@" v"$@" | |
rm -f wlc-"$@".tar.bz2.asc | |
gpg --armor --detach-sign wlc-"$@".tar.bz2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment