Skip to content

Commit

Permalink
ci: add github actions for linting/releasing/building container images
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhop committed Dec 17, 2023
1 parent 1709c56 commit f61bdb4
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '>=1.21.4'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: goreleaser

on:
push:
tags:
- 'v*'

permissions:
contents: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.21.4'
cache: true
- name: Go Preflight Tests
run: |
go mod tidy
go test -v ./...
- name: Docker Login (ghcr.io)
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_NS1_EXPORTER_GORELEASER_DEPLOY_PAT }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_NS1_EXPORTER_GORELEASER_DEPLOY_PAT }}

0 comments on commit f61bdb4

Please sign in to comment.