|
| 1 | +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json |
| 2 | + |
| 3 | +project_name: sops |
| 4 | + |
| 5 | +before: |
| 6 | + hooks: |
| 7 | + - go mod download |
| 8 | + |
| 9 | +env: |
| 10 | + - CGO_ENABLED=0 |
| 11 | + - PKG=github.com/getsops/sops/v3/version |
| 12 | + |
| 13 | +report_sizes: true |
| 14 | + |
| 15 | +builds: |
| 16 | + - id: binary-linux |
| 17 | + main: ./cmd/sops |
| 18 | + binary: "{{ .ProjectName }}" |
| 19 | + flags: |
| 20 | + - -trimpath |
| 21 | + - -mod=readonly |
| 22 | + ldflags: |
| 23 | + - > |
| 24 | + -s -w |
| 25 | + -X "{{ .Env.PKG }}.Version={{ .Version }}" |
| 26 | + goos: |
| 27 | + - linux |
| 28 | + goarch: |
| 29 | + - amd64 |
| 30 | + - arm64 |
| 31 | + mod_timestamp: "{{ .CommitTimestamp }}" |
| 32 | + |
| 33 | + - id: binary-darwin |
| 34 | + main: ./cmd/sops |
| 35 | + binary: "{{ .ProjectName }}" |
| 36 | + flags: |
| 37 | + - -trimpath |
| 38 | + - -mod=readonly |
| 39 | + ldflags: |
| 40 | + - > |
| 41 | + -s -w |
| 42 | + -X {{ .Env.PKG }}.Version={{ .Version }} |
| 43 | + goos: |
| 44 | + - darwin |
| 45 | + goarch: |
| 46 | + - amd64 |
| 47 | + - arm64 |
| 48 | + mod_timestamp: "{{ .CommitTimestamp }}" |
| 49 | + |
| 50 | + - id: binary-windows |
| 51 | + main: ./cmd/sops |
| 52 | + binary: "{{ .ProjectName }}" |
| 53 | + flags: |
| 54 | + - -trimpath |
| 55 | + - -buildmode=pie |
| 56 | + - -mod=readonly |
| 57 | + ldflags: |
| 58 | + - > |
| 59 | + -s -w |
| 60 | + -X {{ .Env.PKG }}.Version={{ .Version }} |
| 61 | + goos: |
| 62 | + - windows |
| 63 | + goarch: |
| 64 | + - amd64 |
| 65 | + - arm64 |
| 66 | + mod_timestamp: "{{ .CommitTimestamp }}" |
| 67 | + |
| 68 | +universal_binaries: |
| 69 | + - id: binary-darwin-universal |
| 70 | + ids: |
| 71 | + - binary-darwin |
| 72 | + name_template: '{{ .ProjectName }}' |
| 73 | + replace: false |
| 74 | + mod_timestamp: "{{ .CommitTimestamp }}" |
| 75 | + |
| 76 | +nfpms: |
| 77 | + - id: deb |
| 78 | + package_name: '{{ .ProjectName }}' |
| 79 | + file_name_template: '{{ .ConventionalFileName }}' |
| 80 | + vendor: custom-sops |
| 81 | + homepage: https://github.com/{{ .Env.GITHUB_REPOSITORY }} |
| 82 | + maintainer: custom-sops <custom@example.com> |
| 83 | + description: Simple and flexible tool for managing secrets |
| 84 | + license: MPL-2.0 |
| 85 | + formats: |
| 86 | + - deb |
| 87 | + - rpm |
| 88 | + |
| 89 | +snapshot: |
| 90 | + name_template: "{{ incpatch .Version }}-dev-{{ .ShortCommit }}" |
| 91 | + |
| 92 | +archives: |
| 93 | + - id: archive-unix |
| 94 | + format: binary |
| 95 | + builds: |
| 96 | + - binary-linux |
| 97 | + - binary-darwin |
| 98 | + name_template: '{{ .ProjectName }}-v{{ .Version }}.{{ .Os }}.{{ .Arch }}' |
| 99 | + |
| 100 | + - id: archive-windows |
| 101 | + format: binary |
| 102 | + builds: |
| 103 | + - binary-windows |
| 104 | + name_template: '{{ .ProjectName }}-v{{ .Version }}.{{ .Arch }}' |
| 105 | + |
| 106 | + - id: archive-darwin-universal |
| 107 | + format: binary |
| 108 | + builds: |
| 109 | + - binary-darwin-universal |
| 110 | + name_template: '{{ .ProjectName }}-v{{ .Version }}.darwin' |
| 111 | + |
| 112 | +checksum: |
| 113 | + name_template: "{{ .ProjectName }}-v{{ .Version }}.checksums.txt" |
| 114 | + algorithm: sha256 |
| 115 | + ids: |
| 116 | + - archive-unix |
| 117 | + - archive-windows |
| 118 | + - archive-darwin-universal |
| 119 | + |
| 120 | +changelog: |
| 121 | + use: github-native |
| 122 | + |
| 123 | +release: |
| 124 | + prerelease: auto |
| 125 | + draft: false # 自动发布,而不是存为草稿 |
| 126 | + header: | |
| 127 | + ## Installation |
| 128 | +
|
| 129 | + To install `{{ .ProjectName }}`, download one of the pre-built binaries provided for your platform from the artifacts attached to this release. |
| 130 | +
|
| 131 | + For instance, if you are using Linux on an AMD64 architecture: |
| 132 | +
|
| 133 | + ```shell |
| 134 | + # Download the binary |
| 135 | + curl -LO https://github.com/{{ .Env.GITHUB_REPOSITORY }}/releases/download/{{ .Tag }}/{{ .ProjectName }}-v{{ .Version }}.linux.amd64 |
| 136 | +
|
| 137 | + # Move the binary in to your PATH |
| 138 | + mv {{ .ProjectName }}-v{{ .Version }}.linux.amd64 /usr/local/bin/{{ .ProjectName }} |
| 139 | +
|
| 140 | + # Make the binary executable |
| 141 | + chmod +x /usr/local/bin/{{ .ProjectName }} |
| 142 | + ``` |
| 143 | +
|
| 144 | +brews: |
| 145 | + - name: sops |
| 146 | + repository: |
| 147 | + owner: peiliqiancdt |
| 148 | + name: sops |
| 149 | + token: "{{ .Env.GITHUB_TOKEN }}" |
| 150 | + directory: Formula |
| 151 | + homepage: "https://github.com/peiliqiancdt/sops" |
| 152 | + description: "Editor of encrypted files" |
| 153 | + license: "MPL-2.0" |
| 154 | + ids: |
| 155 | + - archive-unix |
| 156 | + install: | |
| 157 | + bin.install "sops-v#{version}.#{OS.kernel_name.downcase}.#{Hardware::CPU.arch}" => "sops" |
| 158 | + test: | |
| 159 | + system "#{bin}/sops", "--version" |
0 commit comments