Skip to content

Commit

Permalink
add go releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
ross96D committed Aug 23, 2024
1 parent cfea2e7 commit 94b61f2
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- "*"

permissions:
contents: write

jobs:
goreleaser:
name: Create release-artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 changes: 52 additions & 0 deletions .goreleaser
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...

git:
tag_sort: -version:creatordate

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
# - darwin

ldflags:
- -s -w -X main.Date={{.CommitDate}}

goarch:
- amd64

# ensure a reproducible build.
mod_timestamp: "{{ .CommitTimestamp }}"

archives:
- format: binary

release:
mode: append
github:
owner: ross96D
name: updater

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

0 comments on commit 94b61f2

Please sign in to comment.