Skip to content

Commit

Permalink
chore: using goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
just-hms committed Dec 6, 2024
1 parent 1fe8979 commit 44c96ee
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 24 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
# .github/workflows/release.yml
name: goreleaser

on:
release:
types: [created]
pull_request:
push:
tags:
- "*"

permissions:
contents: write
packages: write
contents: write

jobs:
releases-matrix:
name: Release Go Binary
goreleaser:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: latest
binary_name: "dow"
extra_files: LICENSE README.md
- 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@v6
with:
distribution: goreleaser
version: 'latest'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
project_name: dow
builds:
- goos:
- linux
- windows
- darwin
- goarch:
- amd64
- arm64
- main: .
- binary: dow


archives:
- format: tar.gz
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE
- README.md

0 comments on commit 44c96ee

Please sign in to comment.