Skip to content

Commit

Permalink
[feat] goreleaser github actions #6
Browse files Browse the repository at this point in the history
  • Loading branch information
ronething committed Mar 9, 2022
1 parent d10ad2f commit ac9afd8
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: goreleaser

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

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ bin/

config/dev.yaml

go.sum
go.sum
dist/
25 changes: 25 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
project_name: gocn-push

env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- main: ./cmd
binary: gocn-push
ldflags: '-s -w'
goos:
- linux
- windows
- darwin
archives:
- files:
- README.md
format_overrides:
- goos: windows
format: zip
release:
prerelease: auto
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ require (
github.com/spf13/viper v1.7.1
github.com/temoto/robotstxt v1.1.1 // indirect
google.golang.org/appengine v1.6.6 // indirect
gopkg.in/resty.v1 v1.12.0
)

0 comments on commit ac9afd8

Please sign in to comment.