Skip to content

Commit

Permalink
Add Github actions release
Browse files Browse the repository at this point in the history
  • Loading branch information
boynux committed Apr 22, 2023
1 parent 6216f94 commit 030d838
Show file tree
Hide file tree
Showing 538 changed files with 74,684 additions and 27,335 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [boynux]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: boynux
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
44 changes: 44 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docker Image CI

on:
push:
branches: [master]
tags: ['v*']

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build the Docker image
run: docker build -t squid-exporter .

- name: Tag the Docker image latest
run: docker tag squid-exporter ${{ secrets.DOCKER_USERNAME }}/squid-exporter:latest

- name: Push the Docker image latest
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/squid-exporter:latest

- name: Tag the Docker image version
if: startsWith(github.ref, 'refs/tags/v')
run: docker tag squid-exporter ${{ secrets.DOCKER_USERNAME }}/squid-exporter:${{ github.ref_name }}

- name: Push the Docker image latest
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/squid-exporter:${{ github.ref_name }}
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Makefile CI

on:
push:
tags:
- "v*"
branches:
- "master"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Go environment
uses: actions/setup-go@v4.0.0
with:
# Path to the go.mod or go.work file.
go-version-file: go.mod

- name: Build
run: make

- name: upload
uses: actions/upload-artifact@master
with:
name: binary
path: bin/squid-exporter

release:
runs-on: ubuntu-latest

steps:
- name: Download binaries for release
uses: actions/download-artifact@v3
with:
name: binary
path: bin

- name: Release latest version
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
asset_name: squid-exporter
file: bin/squid-exporter
tag: unstable
overwrite: true
body: "pre-release"
prerelease: true
- name: Release tag version
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/squid-exporter
asset_name: squid-exporter
tag: ${{ github.ref }}
overwrite: true
body: "Stable release"

needs: [build]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/boynux/squid-exporter)

[![Build Status](https://travis-ci.com/boynux/squid-exporter.svg?branch=master)](https://travis-ci.com/boynux/squid-exporter)
[![Github Actions](https://github.com/boynux/squid-exporter/actions/workflows/release.yml/badge.svg)](https://github.com/boynux/squid-exporter/actions/workflows/release.yml)
[![Github Docker](https://github.com/boynux/squid-exporter/actions/workflows/docker.yml/badge.svg)](https://github.com/boynux/squid-exporter/actions/workflows/docker.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/boynux/squid-exporter)](https://goreportcard.com/report/github.com/boynux/squid-exporter)
[![Maintainability](https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/maintainability)](https://codeclimate.com/github/boynux/squid-exporter)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3TH7YAMMEC5L4&source=url)
Expand Down
14 changes: 13 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
module github.com/boynux/squid-exporter

go 1.13
go 1.19

require (
github.com/pires/go-proxyproto v0.6.2
github.com/prometheus/client_golang v1.12.2
github.com/prometheus/common v0.34.0
github.com/stretchr/testify v1.7.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
2 changes: 1 addition & 1 deletion helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func TestCreatProxyHelper(t *testing.T) {
cfg := &config.Config{
ListenAddress: "192.0.2.1:3192",
SquidHostname: "localhost",
SquidHostname: "127.0.0.1",
SquidPort: 3128,
}

Expand Down
8 changes: 0 additions & 8 deletions vendor/github.com/cespare/xxhash/v2/.travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions vendor/github.com/cespare/xxhash/v2/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions vendor/github.com/cespare/xxhash/v2/go.mod

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion vendor/github.com/cespare/xxhash/v2/xxhash.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 31 additions & 31 deletions vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 030d838

Please sign in to comment.