Skip to content

Commit

Permalink
add release ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Mar 4, 2024
1 parent 95d3cec commit 534a696
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Main WorkFlow
on:
push:
tags:
- '*'

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

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21.0

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: v1.24.0
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72 changes: 72 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
before:
hooks:
- go mod tidy

gomod:
proxy: true
env:
- GOPROXY=https://goproxy.cn,https://goroxy.io,https://proxy.golang.org,direct
- GOSUMDB=sum.golang.org
mod: mod

builds:
- main: ./cmd/inkd
env:
- CGO_ENABLED=0
- >-
{{- if eq .Os "darwin" }}
{{- if eq .Arch "amd64"}}CC=o64-clang{{- end }}
{{- if eq .Arch "arm64"}}CC=aarch64-apple-darwin20.2-clang{{- end }}
{{- end }}
{{- if eq .Os "windows" }}
{{- if eq .Arch "amd64" }}CC=x86_64-w64-mingw32-gcc{{- end }}
{{- end }}
goos:
- darwin
- linux
goarch:
- amd64
- arm64
- main: ./cmd/inker
env:
- CGO_ENABLED=0
- >-
{{- if eq .Os "darwin" }}
{{- if eq .Arch "amd64"}}CC=o64-clang{{- end }}
{{- if eq .Arch "arm64"}}CC=aarch64-apple-darwin20.2-clang{{- end }}
{{- end }}
{{- if eq .Os "windows" }}
{{- if eq .Arch "amd64" }}CC=x86_64-w64-mingw32-gcc{{- end }}
{{- end }}
goos:
- darwin
- linux
goarch:
- amd64
- arm64
- main: ./cmd/inkctl
env:
- CGO_ENABLED=0
- >-
{{- if eq .Os "darwin" }}
{{- if eq .Arch "amd64"}}CC=o64-clang{{- end }}
{{- if eq .Arch "arm64"}}CC=aarch64-apple-darwin20.2-clang{{- end }}
{{- end }}
{{- if eq .Os "windows" }}
{{- if eq .Arch "amd64" }}CC=x86_64-w64-mingw32-gcc{{- end }}
{{- end }}
goos:
- darwin
- linux
goarch:
- amd64
- arm64

archives:
- name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}'
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

0 comments on commit 534a696

Please sign in to comment.