github.com/fastly/cli@v1.7.2-0.20240304164155-9d0f1d77c3bf/.goreleaser.yml (about) 1 # https://goreleaser.com/customization/project/ 2 project_name: fastly 3 4 # https://goreleaser.com/customization/release/ 5 release: 6 draft: true 7 prerelease: auto 8 extra_files: 9 - glob: "dist/usage.json" 10 11 # https://goreleaser.com/customization/hooks/ 12 before: 13 hooks: 14 - go mod tidy 15 - go mod download 16 17 # https://goreleaser.com/customization/builds/ 18 builds: 19 - <<: &build_defaults 20 main: ./cmd/fastly 21 ldflags: 22 - -s -w -X "github.com/fastly/cli/pkg/revision.AppVersion=v{{ .Version }}" 23 - -X "github.com/fastly/cli/pkg/revision.GitCommit={{ .ShortCommit }}" 24 - -X "github.com/fastly/cli/pkg/revision.GoHostOS={{ .Env.GOHOSTOS }}" 25 - -X "github.com/fastly/cli/pkg/revision.GoHostArch={{ .Env.GOHOSTARCH }}" 26 - -X "github.com/fastly/cli/pkg/revision.Environment=release" 27 env: 28 - CGO_ENABLED=0 29 id: macos 30 goos: [darwin] 31 goarch: [amd64, arm64] 32 - <<: *build_defaults 33 env: 34 - CGO_ENABLED=0 35 id: linux 36 goos: [linux] 37 goarch: ["386", amd64, arm64] 38 - <<: *build_defaults 39 env: 40 - CGO_ENABLED=0 41 id: windows 42 goos: [windows] 43 goarch: ["386", amd64, arm64] 44 - <<: *build_defaults 45 env: 46 - CGO_ENABLED=0 47 id: generate-usage 48 goos: [linux] 49 goarch: [amd64] 50 binary: 'fastly-usage' # we rename the binary to prevent an error caused by the earlier 'linux/amd64' step 51 # which already creates a 'fastly' binary in '/usr/local/bin'. 52 hooks: 53 post: 54 - cmd: "scripts/documentation.sh {{ .Path }}" 55 56 # https://goreleaser.com/customization/archive/ 57 archives: 58 - id: nix 59 builds: [macos, linux] 60 <<: &archive_defaults 61 name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" 62 files: 63 - none* 64 wrap_in_directory: false 65 format: tar.gz 66 - id: windows-tar 67 builds: [windows] 68 <<: *archive_defaults 69 wrap_in_directory: false 70 format: tar.gz 71 - id: windows-zip 72 builds: [windows] 73 <<: *archive_defaults 74 wrap_in_directory: false 75 format: zip 76 77 # https://goreleaser.com/customization/aur/ 78 aurs: 79 - 80 homepage: "https://github.com/fastly/cli" 81 description: "A CLI for interacting with the Fastly platform" 82 maintainers: 83 - 'oss@fastly.com' 84 license: "Apache license 2.0" 85 skip_upload: auto 86 provides: 87 - fastly 88 conflicts: 89 - fastly 90 91 # The SSH private key that should be used to commit to the Git repository. 92 # This can either be a path or the key contents. 93 # 94 # WARNING: do not expose your private key in the config file! 95 private_key: '{{ .Env.AUR_KEY }}' 96 97 # The AUR Git URL for this package. 98 # Defaults to empty. 99 git_url: 'ssh://aur@aur.archlinux.org/fastly-bin.git' 100 101 # List of packages that are not needed for the software to function, 102 # but provide additional features. 103 # 104 # Must be in the format `package: short description of the extra functionality`. 105 # 106 # Defaults to empty. 107 optdepends: 108 - 'viceroy: for running service locally' 109 110 # The value to be passed to `GIT_SSH_COMMAND`. 111 # 112 # 113 # Defaults to `ssh -i {{ .KeyPath }} -o StrictHostKeyChecking=accept-new -F /dev/null`. 114 git_ssh_command: 'ssh -i {{ .KeyPath }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -F /dev/null' 115 116 # https://goreleaser.com/customization/homebrew/ 117 brews: 118 - name: fastly 119 ids: [nix] 120 repository: 121 owner: fastly 122 name: homebrew-tap 123 skip_upload: auto 124 description: A CLI for interacting with the Fastly platform 125 homepage: https://github.com/fastly/cli 126 folder: Formula 127 custom_block: | 128 head do 129 url "https://github.com/fastly/cli.git" 130 depends_on "go" 131 end 132 install: | 133 system "make" if build.head? 134 bin.install "fastly" 135 (bash_completion/"fastly.sh").write `#{bin}/fastly --completion-script-bash` 136 (zsh_completion/"_fastly").write `#{bin}/fastly --completion-script-zsh` 137 test: | 138 help_text = shell_output("#{bin}/fastly --help") 139 assert_includes help_text, "Usage:" 140 141 # https://goreleaser.com/customization/nfpm/ 142 nfpms: 143 - license: Apache 2.0 144 maintainer: Fastly 145 homepage: https://github.com/fastly/cli 146 bindir: /usr/local/bin 147 description: CLI tool for interacting with the Fastly API. 148 formats: 149 - deb 150 - rpm 151 contents: 152 - src: deb-copyright 153 dst: /usr/share/doc/fastly/copyright 154 packager: deb 155 156 # https://goreleaser.com/customization/checksum/ 157 checksum: 158 name_template: "{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS" 159 160 # https://goreleaser.com/customization/snapshots/ 161 snapshot: 162 name_template: "{{ .Tag }}-next" 163 164 # https://goreleaser.com/customization/changelog/ 165 changelog: 166 disable: true 167 168 # https://goreleaser.com/customization/docker/ 169 # dockers: 170 # - <<: &build_opts 171 # use: buildx 172 # goos: linux 173 # goarch: amd64 174 # image_templates: 175 # - "ghcr.io/fastly/cli:{{ .Version }}" 176 # build_flag_templates: 177 # - "--platform=linux/amd64" 178 # - --label=title={{ .ProjectName }} 179 # - --label=description={{ .ProjectName }} 180 # - --label=url=https://github.com/fastly/cli 181 # - --label=source=https://github.com/fastly/cli 182 # - --label=version={{ .Version }} 183 # - --label=created={{ time "2006-01-02T15:04:05Z07:00" }} 184 # - --label=revision={{ .FullCommit }} 185 # - --label=licenses=Apache-2.0 186 # dockerfile: Dockerfile-assemblyscript 187 # - <<: *build_opts 188 # dockerfile: Dockerfile-rust