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 6, 2024
1 parent 95d3cec commit 5c21a8e
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
tags:
pull_request:

jobs:
Expand All @@ -21,7 +20,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.54.2
version: v1.54

- name: Install Dependencies
run: go get -v -t -d ./...
Expand Down
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'
3 changes: 1 addition & 2 deletions core/service/common/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import (
"fmt"
"strings"

"gorm.io/gorm"

"github.com/99nil/gopkg/sets"
"gorm.io/gorm"

storageV1 "github.com/zc2638/ink/pkg/api/storage/v1"
"github.com/zc2638/ink/pkg/database"
Expand Down

0 comments on commit 5c21a8e

Please sign in to comment.