Skip to content

Commit

Permalink
Add back tar to release assets and also publish on images.metal-stack…
Browse files Browse the repository at this point in the history
….io (#13)

* Add back tar to release assets and also publish on images.metal-stack.io.

* Also setup gcloud.
  • Loading branch information
Gerrit91 authored Mar 9, 2023
1 parent f5082bd commit 6f0ae46
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
16 changes: 0 additions & 16 deletions .github/ISSUE_TEMPLATE/new-metric-request.md

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
branches:
- master

env:
GCS_BUCKET: images.metal-pod.io

jobs:
build:
name: Build
Expand All @@ -25,6 +28,13 @@ jobs:
with:
go-version: '1.20'

- uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -36,14 +46,25 @@ jobs:
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "GITHUB_TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "GITHUB_TAG_NAME=latest" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "TARGET_BINARY_LOCATION=pull-requests/$(echo $GITHUB_REF | awk -F / '{print $3}')-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "TARGET_BINARY_LOCATION=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "TARGET_BINARY_LOCATION=latest" >> $GITHUB_ENV || true
- name: Build project
run: |
make
- name: Upload image tarballs to GCS
run: |
mkdir -p nftables-exporter/${TARGET_BINARY_LOCATION}
cp bin/* nftables-exporter/${TARGET_BINARY_LOCATION}/
gsutil -m cp -r -p nftables-exporter gs://$GCS_BUCKET
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
bin/nftables-exporter*
nftables-exporter.tgz
if: ${{ github.event_name == 'release' }}
Binary file added nftables-exporter.tgz
Binary file not shown.
19 changes: 19 additions & 0 deletions rel/etc/systemd/system/nftables-exporter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Unit]
Description=nftables exporter service
After=network-online.target

[Service]
Type=simple
PIDFile=/run/nftables_exporter.pid
ExecStart=/usr/bin/nftables-exporter
User=root
Group=root
SyslogIdentifier=nftables-exporter
Restart=on-failure
RemainAfterExit=no
RestartSec=100ms
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

0 comments on commit 6f0ae46

Please sign in to comment.