You've already forked prometheus-exporters
add arm64
This commit is contained in:
@@ -73,7 +73,7 @@ jobs:
|
||||
build:
|
||||
needs: validate
|
||||
if: needs.validate.outputs.build == 'true'
|
||||
#timeout-minutes: 2
|
||||
timeout-minutes: 2
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -92,17 +92,24 @@ jobs:
|
||||
run: git clone https://github.com/jonnenauha/prometheus_varnish_exporter varnish
|
||||
|
||||
- name: Build varnish exporter for GNU/Linux / amd64
|
||||
run: GOOS=linux GOARCH=amd64 go build -o ../bin/prometheus-varnish-exporter-amd64
|
||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ../bin/prometheus-varnish-exporter-amd64
|
||||
working-directory: varnish
|
||||
|
||||
- name: Build varnish exporter for GNU/Linux / arm64
|
||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o ../bin/prometheus-varnish-exporter-arm64
|
||||
working-directory: varnish
|
||||
|
||||
- name: Create deb dir tree
|
||||
run: |
|
||||
mkdir -p varnish-exporter-amd64/usr/bin
|
||||
mkdir -p varnish-exporter-amd64/DEBIAN
|
||||
mkdir -p varnish-exporter-arm64/usr/bin
|
||||
mkdir -p varnish-exporter-arm64/DEBIAN
|
||||
|
||||
- name: Copy binaries
|
||||
run: |
|
||||
cp bin/prometheus-varnish-exporter-amd64 varnish-exporter-amd64/usr/bin/prometheus-varnish-exporter
|
||||
cp bin/prometheus-varnish-exporter-arm64 varnish-exporter-arm64/usr/bin/prometheus-varnish-exporter
|
||||
|
||||
- name: Prepare amd64 control file
|
||||
run: |
|
||||
@@ -113,14 +120,26 @@ jobs:
|
||||
echo "Homepage: https://git.brainsys.io/packages/prometheus-exporters" >> varnish-exporter-amd64/DEBIAN/control
|
||||
echo "Description: Prometheus Varnish Exporter package for GNU/Linux Debian" >> varnish-exporter-amd64/DEBIAN/control
|
||||
|
||||
- name: Prepare arm64 control file
|
||||
run: |
|
||||
echo "Package: prometheus-varnish-exporter" > varnish-exporter-arm64/DEBIAN/control
|
||||
echo "Version: $VERSION" >> varnish-exporter-arm64/DEBIAN/control
|
||||
echo "Maintainer: Ludovic Cartier <ludovic.cartier@brainsys.io>" >> varnish-exporter-arm64/DEBIAN/control
|
||||
echo "Architecture: arm64" >> varnish-exporter-arm64/DEBIAN/control
|
||||
echo "Homepage: https://git.brainsys.io/packages/prometheus-exporters" >> varnish-exporter-arm64/DEBIAN/control
|
||||
echo "Description: Prometheus Varnish Exporter package for GNU/Linux Debian" >> varnish-exporter-arm64/DEBIAN/control
|
||||
|
||||
- name: Build deb files
|
||||
run: |
|
||||
dpkg -b varnish-exporter-amd64 bin/prometheus-varnish-exporter_$VERSION-1_amd64.deb
|
||||
dpkg -b varnish-exporter-arm64 bin/prometheus-varnish-exporter_$VERSION-1_arm64.deb
|
||||
|
||||
- name: Release packages
|
||||
run: |
|
||||
curl -s -u "${{ secrets.PACKAGE_TOKEN }}" --upload-file bin/prometheus-varnish-exporter_$VERSION-1_amd64.deb \
|
||||
https://git.brainsys.io/api/packages/packages/debian/pool/stable/main/upload
|
||||
curl -s -u "${{ secrets.PACKAGE_TOKEN }}" --upload-file bin/prometheus-varnish-exporter_$VERSION-1_arm64.deb \
|
||||
https://git.brainsys.io/api/packages/packages/debian/pool/stable/main/upload
|
||||
|
||||
- name: Create release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
|
||||
Reference in New Issue
Block a user