-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add build and release CI using goreleaser
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build | ||
|
||
# Run when tags are pushed or manually | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
# contents: write is required to publish artifacts | ||
# https://goreleaser.com/ci/actions/#token-permissions | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.21.x' | ||
|
||
- name: Go lint | ||
run: | | ||
go install golang.org/x/lint/golint@latest | ||
golint . | ||
- name: Staticcheck | ||
run: | | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
staticcheck . | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
project_name: SecretLinks | ||
|
||
builds: | ||
- id: linux | ||
ldflags: | ||
- -s -w # do not include debug symbols in executables | ||
- -X 'main.version={{.Version}}' # set version information in-program | ||
env: [CGO_ENABLED=0] | ||
goos: [linux] | ||
goarch: [amd64] | ||
goamd64: [v1] | ||
|
||
archives: | ||
- format: zip | ||
|
||
changelog: | ||
filters: | ||
exclude: | ||
- '^(?i)ci:' | ||
- '^(?i)readme:' | ||
|
||
release: | ||
name_template: "Version {{.Version}}" | ||
prerelease: auto | ||
draft: true | ||
|