mirror of https://github.com/liamg/aminal.git
Add .deb for debian/ubuntu
This commit is contained in:
parent
7da69c342c
commit
00b78df336
|
@ -24,6 +24,19 @@ jobs:
|
||||||
root: bin
|
root: bin
|
||||||
paths:
|
paths:
|
||||||
- linux
|
- linux
|
||||||
|
package-debian:
|
||||||
|
docker:
|
||||||
|
- image: liamg/golang-opengl
|
||||||
|
working_directory: /go/src/github.com/liamg/aminal
|
||||||
|
requires:
|
||||||
|
- build
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run: make package-debian
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: bin
|
||||||
|
paths:
|
||||||
|
- debian
|
||||||
build-darwin:
|
build-darwin:
|
||||||
docker:
|
docker:
|
||||||
- image: karalabe/xgo-latest:latest
|
- image: karalabe/xgo-latest:latest
|
||||||
|
@ -49,6 +62,7 @@ jobs:
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
cp artifacts/linux/* release/
|
cp artifacts/linux/* release/
|
||||||
cp artifacts/darwin/* release/
|
cp artifacts/darwin/* release/
|
||||||
|
cp artifacts/debian/* release/
|
||||||
go get github.com/tcnksm/ghr
|
go get github.com/tcnksm/ghr
|
||||||
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -n "Aminal ${CIRCLE_TAG}" -b "Aminal ${CIRCLE_TAG}" -delete ${CIRCLE_TAG} release/
|
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -n "Aminal ${CIRCLE_TAG}" -b "Aminal ${CIRCLE_TAG}" -delete ${CIRCLE_TAG} release/
|
||||||
workflows:
|
workflows:
|
||||||
|
@ -71,10 +85,17 @@ workflows:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /^v.*/
|
only: /^v.*/
|
||||||
|
- package-debian:
|
||||||
|
requires:
|
||||||
|
- test
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /^v.*/
|
||||||
- release:
|
- release:
|
||||||
requires:
|
requires:
|
||||||
- build-linux
|
- build-linux
|
||||||
- build-darwin
|
- build-darwin
|
||||||
|
- package-debian
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /^v.*/
|
only: /^v.*/
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -36,3 +36,7 @@ build-linux:
|
||||||
build-darwin:
|
build-darwin:
|
||||||
mkdir -p bin/darwin
|
mkdir -p bin/darwin
|
||||||
xgo -x -v -ldflags "-X main.Version='${CIRCLE_TAG}'" --targets=darwin/amd64 -out bin/darwin/${BINARY} .
|
xgo -x -v -ldflags "-X main.Version='${CIRCLE_TAG}'" --targets=darwin/amd64 -out bin/darwin/${BINARY} .
|
||||||
|
|
||||||
|
.PHONY: package-debian
|
||||||
|
package-debian: build-linux
|
||||||
|
./scripts/package-debian.sh "${CIRCLE_TAG}" bin/linux/${BINARY}-linux-amd64
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
VERSION=${1//v}
|
||||||
|
BINARYFILE=$2
|
||||||
|
|
||||||
|
if [[ "$VERSION" == "" ]]; then
|
||||||
|
echo "No version specified"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$BINARYFILE" == "" ]]; then
|
||||||
|
echo "No path to binary specified"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf package
|
||||||
|
mkdir -p package/DEBIAN
|
||||||
|
mkdir -p package/usr/local/bin/
|
||||||
|
cp $BINARYFILE package/usr/local/bin/aminal
|
||||||
|
chmod +x package/usr/local/bin/aminal
|
||||||
|
|
||||||
|
cat > package/DEBIAN/control <<- EOM
|
||||||
|
Package: aminal
|
||||||
|
Version: $VERSION
|
||||||
|
Maintainer: Liam Galvin
|
||||||
|
Architecture: amd64
|
||||||
|
Description: A Modern Terminal Emulator
|
||||||
|
EOM
|
||||||
|
|
||||||
|
dpkg-deb --build package
|
||||||
|
rm -rf package
|
||||||
|
|
||||||
|
mkdir -p bin/debian
|
||||||
|
mv package.deb bin/debian/${BINARYFILE}.deb
|
|
@ -1,30 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
git tag "${VERSION}"
|
|
||||||
git push origin "${VERSION}"
|
|
||||||
github-release release \
|
|
||||||
--user liamg \
|
|
||||||
--repo aminal \
|
|
||||||
--tag "${VERSION}" \
|
|
||||||
--name "Aminal ${VERSION}"
|
|
||||||
github-release upload \
|
|
||||||
--user liamg \
|
|
||||||
--repo aminal \
|
|
||||||
--tag "${VERSION}" \
|
|
||||||
--name "${BINARY}-osx-amd64" \
|
|
||||||
--file release/bin/darwin/amd64/${BINARY}
|
|
||||||
github-release upload \
|
|
||||||
--user liamg \
|
|
||||||
--repo aminal \
|
|
||||||
--tag "${VERSION}" \
|
|
||||||
--name "${BINARY}-linux-amd64" \
|
|
||||||
--file release/bin/linux/amd64/${BINARY}
|
|
||||||
github-release upload \
|
|
||||||
--user liamg \
|
|
||||||
--repo aminal \
|
|
||||||
--tag "${VERSION}" \
|
|
||||||
--name "${BINARY}-linux-386" \
|
|
||||||
--file release/bin/linux/386/${BINARY}
|
|
Loading…
Reference in New Issue