Skip to content

Commit

Permalink
CI/CD (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
vertisan authored Aug 30, 2024
1 parent 8648c4f commit 2766712
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: release

on:
push:
branches:
- 'master'
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: write

env:
GO_VERSION: "1.22"

jobs:
goreleaser:
runs-on: personal
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Tidy Go Mod
run: go mod tidy

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
if: success() && startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
vault-snapshot-agent
dist
dist/
33 changes: 33 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
before:
hooks:
- go mod tidy -compat 1.22
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- "386"
- amd64
- arm
- arm64
goarm:
- "6"
- "7"

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 2766712

Please sign in to comment.