Add build infra

This commit is contained in:
2021-12-06 17:33:53 +00:00
parent cee9a58e4c
commit 7174c924b5
5 changed files with 75 additions and 6 deletions

5
.github/renovate.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"extends": [
"config:base"
]
}

View File

@@ -0,0 +1,32 @@
name: ci
on:
push:
branches:
- "master"
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/aaisp-exporter:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/aaisp-exporter:latest

28
.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,28 @@
on:
release:
types: [created]
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v2
- uses: wangyoucao577/go-release-action@v1.22
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.17.4.linux-amd64.tar.gz"
project_path: "./cmd/aaisp_exporter"
binary_name: "aaisp_exporter"
extra_files: LICENSE cmd/aaisp_exporter/README.md