Goreleaser

使用goreleaser编译go program

OK!

git clone to G:\_codes\-
download go from https://golang.org/dl/
install to g:\Program Files\Go\

install goreleaser from link https://goreleaser.com/install/
go install github.com/goreleaser/goreleaser@latest


follow https://goreleaser.com/quick-start/
create main.go
goreleaser init
go mod init testhjs
create a repo
goreleaser check
goreleaser release --snapshot --skip-publish --rm-dist


cd G:\_codes\-
goreleaser init
goreleaser check
goreleaser release --snapshot --skip-publish --rm-dist

LOGGING as below

G:\_codes\->goreleaser release --snapshot --skip-publish --rm-dist
   releasing...
   • loading config file       file=.goreleaser.yml
   • loading environment variablesgetting and validating git statebuilding...               commit=20e66235c2c50a6906d4cc6c52fc1c77e812daff latest tag=v1.3.4-vetch101pipe skipped              error=disabled during snapshot modeparsing tagrunning before hooksrunning                   hook=go mod tidyrunning                   hook=go generate ./...
   • setting defaultssnapshottinggithub/gitlab/gitea releasesproject nameloading go mod informationbuilding binariescreating source archivearchiveslinux packagessnapcraft packagescalculating checksumssigning artifactssigning docker imagesdocker imagesdocker manifestsartifactoryblobshomebrew tap formulascoop manifeststwitterredditslackmilestonessnapshottingbuilding snapshot...      version=1.3.4-next
   checking ./dist
      • --rm-dist is set, cleaning it uploading go mod informationwriting effective config filewriting                   config=dist\config.yaml
   • generating changelogpipe skipped              error=not available for snapshotsbuilding binariesbuilding                  binary=G:\_codes\-\dist\-_linux_arm_7\-building                  binary=G:\_codes\-\dist\-_windows_arm_7\-.exe
      • building                  binary=G:\_codes\-\dist\-_linux_386\-building                  binary=G:\_codes\-\dist\-_windows_386\-.exe
   • archivescreating                  archive=dist\-_1.3.4-next_Windows_armv7.tar.gz
      • creating                  archive=dist\-_1.3.4-next_Linux_i386.tar.gz
      • creating                  archive=dist\-_1.3.4-next_Linux_armv7.tar.gz
      • creating                  archive=dist\-_1.3.4-next_Windows_i386.tar.gz
   • creating source archivelinux packagessnapcraft packagescalculating checksumschecksumming              file=-_1.3.4-next_Linux_armv7.tar.gz
      • checksumming              file=-_1.3.4-next_Linux_i386.tar.gz
      • checksumming              file=-_1.3.4-next_Windows_i386.tar.gz
      • checksumming              file=-_1.3.4-next_Windows_armv7.tar.gz
   • signing artifactsdocker imagespublishingblobshttp uploadcustom publisherartifactorydocker imagespipe skipped              error=publishing is disableddocker manifestspipe skipped              error=publishing is disabledsnapcraft packagespipe skipped              error=publishing is disabledgithub/gitlab/gitea releasespipe skipped              error=publishing is disabledhomebrew tap formulascoop manifestsmilestonespipe skipped              error=publishing is disabledsigning docker imagespipe skipped              error=artifact signing is disabledannouncingtwitterpipe skipped              error=announcing is disabledredditpipe skipped              error=announcing is disabledslackpipe skipped              error=announcing is disabledrelease succeeded after 44.35s

.goreleaser.yml

# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
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:
  - env:
      - CGO_ENABLED=0
    goos:
      - linux
      - windows
      #- darwin
    goarch:
      #- amd64
      - 386
      - arm
      #- arm64
    goarm:
      #- 6
      - 7      
archives:
  - replacements:
      darwin: Darwin
      linux: Linux
      windows: Windows
      386: i386
      amd64: x86_64
checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: "-next"
changelog:
  sort: asc
  filters:
    exclude:
      - '^docs:'
      - '^test:'

Powered by Jekyll and Theme by solid

本站总访问量