Skip to content

Commit

Permalink
add release to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoWK committed Sep 5, 2023
1 parent 55892d5 commit 06e7afa
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Build, Test and Release Binaries

on:
push:
branches:
- master

jobs:
build:
Expand All @@ -23,6 +20,22 @@ jobs:

- name: Run Tests
run: go test ./...
release:
if: startsWith(github.event.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.21

- name: Extract EXPORTER_VERSION
id: extract_exporter_version
run: echo "::set-output name=version::$(cat VERSION)"

- name: Run Goreleaser
if: ${{ github.event_name != 'pull_request' }}
Expand All @@ -31,4 +44,4 @@ jobs:
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --clean
args: release --clean
19 changes: 18 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ builds:
- linux
goarch:
- amd64
- arm64

#Configuration for building packages for apk, deb and rpm package managers
nfpms:
Expand All @@ -42,4 +43,20 @@ nfpms:
dst: /etc/systemd/system/prometheus-libvirt-exporter.service

- src: debian/prometheus-libvirt-exporter.upstart
dst: /etc/init/prometheus-libvirt-exporter.conf
dst: /etc/init/prometheus-libvirt-exporter.conf

archives:
- name_template: "{{ .ProjectName }}_{{ .Env.EXPORTER_VERSION }}_{{ .Os }}_{{ .Arch }}"
format: tar.gz

checksum:
name_template: "{{ .ProjectName }}-{{ .Env.EXPORTER_VERSION }}_checksums.txt"
algorithm: sha256

# Configuration for GitHub Releases
release:
github:
owner: Knalltuete5000
name: prometheus-libvirt-exporter
draft: true
replace_existing_draft: true
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
v0.0.1-alpha

0 comments on commit 06e7afa

Please sign in to comment.