Skip to content

Commit

Permalink
Merge pull request #129 from mna/goreleaser-gh-action
Browse files Browse the repository at this point in the history
Add goreleaser & GH action for deps update
  • Loading branch information
breml authored Sep 22, 2023
2 parents c276fba + 898e807 commit 3dfffb7
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://github.com/actions/go-dependency-submission
name: dependency-submission
on:
push:
branches:
- master

permissions:
contents: write

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.20"
- uses: actions/go-dependency-submission@v1
with:
go-mod-path: go.mod
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: goreleaser

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

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

-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"

-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/marketplace/actions/go-proxy-warming
pkg-go-dev-warming:
name: Renew documentation
runs-on: ubuntu-latest
steps:
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@master
34 changes: 34 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- main: .
binary: pigeon
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- name_template: >-
{{- .Binary }}_
{{- .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end -}}
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
skip: true
release:
github:
owner: mna
name: pigeon
gomod:
proxy: true

0 comments on commit 3dfffb7

Please sign in to comment.