瀏覽代碼

This patch makes generating releases from git a very simple process; you
simply edit the makefile's "VERSION" line to the new version, commit
that as its own commit, and do: "make test-archive". That'll make a
file in the current directory gnu-efi-$VERSION.tar.bz2 , with its top
level directory gnu-efi-$VERSION/ and the source tree under that.

Once you've tested that and you're sure it's what you want to release,
you do "make archive", which will tag a release in git and generate a
final tarball from it. You then push to the archive, being sure to
include the tag:

git push origin master:master --tags

And upload the archive wherever it's supposed to go.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>

Nigel Croxon 10 年之前
父節點
當前提交
b868aa7566
共有 1 個文件被更改,包括 25 次插入0 次删除
  1. 25 0
      Makefile

+ 25 - 0
Makefile

@@ -34,6 +34,8 @@
 #    SUCH DAMAGE.
 #
 
+VERSION = 3.0u
+
 SRCDIR = $(shell pwd)
 
 VPATH = $(SRCDIR)
@@ -101,3 +103,26 @@ ifeq ($(GCC_VERSION),2)
 endif
 
 include $(SRCDIR)/Make.rules
+
+test-archive:
+	@rm -rf /tmp/gnu-efi-$(VERSION) /tmp/gnu-efi-$(VERSION)-tmp
+	@mkdir -p /tmp/gnu-efi-$(VERSION)-tmp
+	@git archive --format=tar $(shell git branch | awk '/^*/ { print $$2 }') | ( cd /tmp/gnu-efi-$(VERSION)-tmp/ ; tar x )
+	@git diff | ( cd /tmp/gnu-efi-$(VERSION)-tmp/ ; patch -s -p1 -b -z .gitdiff )
+	@mv /tmp/gnu-efi-$(VERSION)-tmp/ /tmp/gnu-efi-$(VERSION)/
+	@dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/gnu-efi-$(VERSION).tar.bz2 gnu-efi-$(VERSION)
+	@rm -rf /tmp/gnu-efi-$(VERSION)
+	@echo "The archive is in gnu-efi-$(VERSION).tar.bz2"
+
+tag:
+	git tag $(VERSION) refs/heads/master
+
+archive: tag
+	@rm -rf /tmp/gnu-efi-$(VERSION) /tmp/gnu-efi-$(VERSION)-tmp
+	@mkdir -p /tmp/gnu-efi-$(VERSION)-tmp
+	@git archive --format=tar $(VERSION) | ( cd /tmp/gnu-efi-$(VERSION)-tmp/ ; tar x )
+	@mv /tmp/gnu-efi-$(VERSION)-tmp/ /tmp/gnu-efi-$(VERSION)/
+	@dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/gnu-efi-$(VERSION).tar.bz2 gnu-efi-$(VERSION)
+	@rm -rf /tmp/gnu-efi-$(VERSION)
+	@echo "The archive is in gnu-efi-$(VERSION).tar.bz2"
+