diff --git a/.github/workflows/release-tag-version.yml b/.github/workflows/release-tag-version.yml new file mode 100644 index 0000000..f57be15 --- /dev/null +++ b/.github/workflows/release-tag-version.yml @@ -0,0 +1,28 @@ +name: release-tag-version + +on: + push: + tags: + - "v0.*" + +jobs: + Build: + name: build-binary + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - run: git fetch --unshallow --quiet --tags --force + + - uses: actions/setup-go@v4 + with: + go-version: '1.20' + go-version-file: 'server/go.mod' + cache-dependency-path: 'server/go.sum' + + - uses: actions/setup-node@v4 + with: + node-version: '16' + + Docker: + name: build-docker \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1e5c7b0..345e432 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ anylink-deploy anylink-deploy.tar.gz -dist \ No newline at end of file +dist +godist \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..c0ddf35 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,62 @@ +#https://goreleaser.com/static/schema.json + +# goreleaser build --skip=validate --clean --debug + +version: 1 + +dist: godist + +before: + hooks: + # You may remove this if you don't use go modules. + #- go mod tidy + # you may remove this if you don't need go generate + #- go generate ./... + +builds: + - id: "build" + #main: . + dir: ./server + env: + - CGO_ENABLED=1 + - >- + {{- 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 "linux" }} + {{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc{{- end }} + {{- if eq .Arch "arm" }}CC=arm-linux-gnueabi-gcc{{- end }} + {{- end }} + goos: + - linux + #- darwin + #- windows + goarch: + - amd64 + - arm64 + - arm + + +archives: + - id: "archive1" + format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"