summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfusion8092016-07-12 14:54:23 +1000
committerfusion8092016-07-12 14:54:23 +1000
commitffc0b71ebd2f768214f4ca7c1a0fa50c6b16ed8f (patch)
tree595061be86869df04e0567d65d957b40a85d0b43
downloadaur-ffc0b71ebd2f768214f4ca7c1a0fa50c6b16ed8f.tar.gz
Initial commit]
-rw-r--r--.SRCINFO19
-rw-r--r--.gitignore4
-rw-r--r--Makefile81
-rw-r--r--PKGBUILD32
4 files changed, 136 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2fb52fe86896
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+# Generated by mksrcinfo v8
+# Tue Jul 12 04:54:23 UTC 2016
+pkgbase = gothub
+ pkgdesc = Command-line app to create and edit releases on GitHub (and upload artifacts)
+ pkgver = 0.7.0
+ pkgrel = 1
+ url = https://github.com/itchio/gothub
+ arch = i686
+ arch = x86_64
+ license = MIT
+ makedepends = go
+ depends = glibc
+ source = https://github.com/itchio/gothub/archive/v0.7.0.tar.gz
+ source = Makefile
+ sha512sums = b38756746633419ff9d3e5da506672a5ae78a0f6aebfaf75fc95562d5a044c8e3d2b50cd96e94942ba5b3b6f08c40380093a087df366f59f9d8eb5f677a18f98
+ sha512sums = a7daf17b750b40db4c1e17aac13de5d76c5de5e197586903a58bf0c094ee7902594fdf44e9e8c75d67386f7773adffefe133743ae70fc3a84ed111f5a37a81e4
+
+pkgname = gothub
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..67242c6bca90
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.xz
+pkg
+src
+*.gz
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..ea543b347c63
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,81 @@
+LAST_TAG := $(shell git describe --abbrev=0 --tags)
+
+USER := itchio
+EXECUTABLE := gothub
+
+# only include the amd64 binaries, otherwise the github release will become
+# too big
+UNIX_EXECUTABLES := \
+ darwin/amd64/$(EXECUTABLE) \
+ freebsd/amd64/$(EXECUTABLE) \
+ linux/amd64/$(EXECUTABLE)
+WIN_EXECUTABLES := \
+ windows/amd64/$(EXECUTABLE).exe
+
+COMPRESSED_EXECUTABLES=$(UNIX_EXECUTABLES:%=%.tar.bz2) $(WIN_EXECUTABLES:%.exe=%.zip)
+COMPRESSED_EXECUTABLE_TARGETS=$(COMPRESSED_EXECUTABLES:%=bin/%)
+
+UPLOAD_CMD = bin/tmp/$(EXECUTABLE) upload -u $(USER) -r $(EXECUTABLE) -t $(LAST_TAG) -n $(subst /,-,$(FILE)) -f bin/$(FILE)
+
+all: $(EXECUTABLE)
+
+# the executable used to perform the upload, dogfooding and all...
+bin/tmp/$(EXECUTABLE):
+ go build -o "$@"
+
+# arm
+bin/linux/arm/5/$(EXECUTABLE):
+ GOARM=5 GOARCH=arm GOOS=linux go build -o "$@"
+bin/linux/arm/7/$(EXECUTABLE):
+ GOARM=7 GOARCH=arm GOOS=linux go build -o "$@"
+
+# 386
+bin/darwin/386/$(EXECUTABLE):
+ GOARCH=386 GOOS=darwin go build -o "$@"
+bin/linux/386/$(EXECUTABLE):
+ GOARCH=386 GOOS=linux go build -o "$@"
+bin/windows/386/$(EXECUTABLE):
+ GOARCH=386 GOOS=windows go build -o "$@"
+
+# amd64
+bin/freebsd/amd64/$(EXECUTABLE):
+ GOARCH=amd64 GOOS=freebsd go build -o "$@"
+bin/darwin/amd64/$(EXECUTABLE):
+ GOARCH=amd64 GOOS=darwin go build -o "$@"
+bin/linux/amd64/$(EXECUTABLE):
+ GOARCH=amd64 GOOS=linux go build -o "$@"
+bin/windows/amd64/$(EXECUTABLE).exe:
+ GOARCH=amd64 GOOS=windows go build -o "$@"
+
+# compressed artifacts, makes a huge difference (Go executable is ~9MB,
+# after compressing ~2MB)
+%.tar.bz2: %
+ tar -jcvf "$<.tar.bz2" "$<"
+%.zip: %.exe
+ zip "$@" "$<"
+
+# git tag -a v$(RELEASE) -m 'release $(RELEASE)'
+release: bin/tmp/$(EXECUTABLE) $(COMPRESSED_EXECUTABLE_TARGETS)
+ git push && git push --tags
+ bin/tmp/$(EXECUTABLE) release -u $(USER) -r $(EXECUTABLE) \
+ -t $(LAST_TAG) -n $(LAST_TAG) || true
+ $(foreach FILE,$(COMPRESSED_EXECUTABLES),$(UPLOAD_CMD);)
+
+# install and/or update all dependencies, run this from the project directory
+# go get -u ./...
+# go test -i ./
+dep:
+ go list -f '{{join .Deps "\n"}}' | xargs go list -e -f '{{if not .Standard}}{{.ImportPath}}{{end}}' | xargs go get -u
+
+$(EXECUTABLE): dep
+ go build -o "$@"
+
+install:
+ go install
+
+clean:
+ rm go-app || true
+ rm $(EXECUTABLE) || true
+ rm -rf bin/
+
+.PHONY: clean release dep install
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b9595901eb70
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: Brenton Horne <brentonhorne77 at gmail dot com>
+
+pkgname=gothub
+pkgver=0.7.0
+pkgrel=1
+pkgdesc="Command-line app to create and edit releases on GitHub (and upload artifacts)"
+arch=('i686' 'x86_64')
+url="https://github.com/itchio/${pkgname}"
+makedepends=('go')
+depends=('glibc')
+license=('MIT')
+source=("${url}/archive/v${pkgver}.tar.gz"
+"Makefile")
+sha512sums=('b38756746633419ff9d3e5da506672a5ae78a0f6aebfaf75fc95562d5a044c8e3d2b50cd96e94942ba5b3b6f08c40380093a087df366f59f9d8eb5f677a18f98'
+ 'a7daf17b750b40db4c1e17aac13de5d76c5de5e197586903a58bf0c094ee7902594fdf44e9e8c75d67386f7773adffefe133743ae70fc3a84ed111f5a37a81e4')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ cp $srcdir/Makefile .
+ GOROOT=/usr/lib/go GOPATH=$HOME/go PATH=$PATH:$GOROOT/bin make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ install -dm755 "${pkgdir}/usr/bin"
+ install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
+
+ install -Dm755 "${pkgname}" \
+ "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm755 LICENSE \
+ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}