Skip to content

Commit a4a59bf

Browse files
author
Ivan Mirić
committed
Bring back previous Go tooling for building DEB and RPM packages
Resolves grafana#1640 (review)
1 parent 6e4fa7c commit a4a59bf

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

.github/workflows/all.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ jobs:
145145
defaults:
146146
run:
147147
shell: bash
148-
env:
149-
FPM_VERSION: "1.11.0"
150148
needs: [lint, test]
151149
if: startsWith(github.ref, 'refs/tags/v')
152150
steps:
@@ -156,10 +154,24 @@ jobs:
156154
uses: actions/setup-go@v2
157155
with:
158156
go-version: 1.14.x
159-
- name: Install fpm
157+
- name: Install package builders
160158
run: |
161-
sudo apt-get update && sudo apt-get install -y ruby ruby-dev rubygems build-essential
162-
sudo gem install --no-document fpm -v $FPM_VERSION
159+
pushd .
160+
tmpdir=$(mktemp -d)
161+
cd "$tmpdir"
162+
go get github.com/Masterminds/glide
163+
go get -d github.com/mh-cbon/go-bin-deb \
164+
&& (cd $GOPATH/src/github.com/mh-cbon/go-bin-deb \
165+
&& glide install \
166+
&& go install)
167+
go get -d github.com/mh-cbon/go-bin-rpm \
168+
&& (cd $GOPATH/src/github.com/mh-cbon/go-bin-rpm \
169+
&& glide install \
170+
&& go install)
171+
apt-get update -y
172+
apt-get install -y fakeroot rpm
173+
popd
174+
rm -rf "$tmpdir"
163175
- name: Build
164176
run: |
165177
go version

build-release.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ package() {
4040
echo "- Creating ${NAME}.${FMT} package..."
4141
case $FMT in
4242
deb|rpm)
43-
fpm --force --verbose --name=k6 --version="$VERSION" \
44-
--vendor=k6 --license=AGPLv3 --url="https://k6.io/" \
45-
--input-type=dir --output-type="$FMT" \
46-
--package="${OUT_DIR}/${NAME}.${FMT}" "${OUT_DIR}/${NAME}/k6=/usr/bin/"
43+
# The go-bin-* tools expect the binary in /tmp/
44+
[ ! -r /tmp/k6 ] && cp "dist/${NAME}/k6" /tmp/k6
45+
"go-bin-${FMT}" generate --file "packaging/${FMT}.json" -a amd64 --version $VERSION -o "dist/k6-v${VERSION}-amd64.${FMT}"
4746
;;
4847
tgz)
4948
tar -C "${OUT_DIR}" -zcf "${OUT_DIR}/${NAME}.tar.gz" "$NAME"

packaging/deb.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"copyrights": [
1616
{
1717
"files": "*",
18-
"copyright": "2018 Load Impact AB",
18+
"copyright": "2020 Load Impact AB",
1919
"license": "AGPL-3.0",
2020
"file": "LICENSE"
2121
}
2222
]
23-
}
23+
}

0 commit comments

Comments
 (0)