Skip to content

Commit

Permalink
Add GitHub Actions support
Browse files Browse the repository at this point in the history
  • Loading branch information
pedropombeiro committed Feb 11, 2023
1 parent 878611c commit 6bf7ab3
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Build qnapexporter

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Test
run: |
make test
- name: Set up Go environment
uses: actions/setup-go@v3
id: go
with:
go-version: 1.19

- name: Build
run: |
make build
- name: Upload build artifacts
uses: actions/upload-artifact@v3.1.2
with:
name: qnapexporter
path: bin/qnapexporter
retention-days: 30
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Release qnapexporter

on:
release:
types: [created]

jobs:
release-linux-amd64:
name: release linux/amd64
runs-on: ubuntu-latest
permissions:
contents: write # for wangyoucao577/go-release-action to upload release assets

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: wangyoucao577/go-release-action@v1.35
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: amd64
build_command: make build
binary_name: bin/qnapexporter
asset_name: qnapexporter
overwrite: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![pipeline status](https://gitlab.com/pedropombeiro/qnapexporter/badges/master/pipeline.svg)](https://gitlab.com/pedropombeiro/qnapexporter/-/commits/master)
[![Build](https://github.com/pedropombeiro/qnapexporter/actions/workflows/main.yml/badge.svg)](https://github.com/pedropombeiro/qnapexporter/actions/workflows/main.yml)

# qnapexporter

Expand All @@ -15,7 +15,7 @@ The Grafana dashboard sources are in the `/dashboards` directory.

## Installation

1. Download the latest qnapexporter executable from the [Releases page](https://gitlab.com/pedropombeiro/qnapexporter/-/releases)
1. Download the latest qnapexporter executable from the [Releases page](https://github.com/pedropombeiro/qnapexporter/releases)
1. Run `qnapexporter`

```shell
Expand Down

0 comments on commit 6bf7ab3

Please sign in to comment.