Skip to content

Commit

Permalink
add goreleaser (#43)
Browse files Browse the repository at this point in the history
* add goreleaser

Signed-off-by: sivchari <[email protected]>

* delete workflow.yml

Signed-off-by: sivchari <[email protected]>

---------

Signed-off-by: sivchari <[email protected]>
  • Loading branch information
sivchari authored Oct 25, 2024
1 parent 7b68c50 commit 3e70ac2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- uses: goreleaser/goreleaser-action@v5
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test_and_lint
name: test

on:
push:
Expand Down Expand Up @@ -28,9 +28,11 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: |
go mod download
- name: Test
run: go test ./...

Expand Down
26 changes: 26 additions & 0 deletions goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
project_name: tenv

env:
- GO111MODULE=on

builds:
- id: tenv
main: ./cmd/tenv/main.go
binary: tenv
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64

archives:
- id: tenv
builds:
- tenv
name_template: '{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format_overrides:
- goos: windows
format: zip

0 comments on commit 3e70ac2

Please sign in to comment.