Skip to content

Fix error checks.

Fix error checks. #12

Workflow file for this run

name: Release a tag
on:
push:
tags: ['*']
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: go test ./...
- name: Generate coverage report
run: ./.github/workflows/codecov.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
build-binary:
needs: [test, lint]
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-docker:
needs: [test, lint]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: tetafro
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: >
ghcr.io/tetafro/connectbox-exporter:latest,
ghcr.io/tetafro/connectbox-exporter:${{ github.ref_name }}