.goreleaser.yml (5733B)
1 # https://goreleaser.com 2 project_name: gotosocial 3 before: 4 # https://goreleaser.com/customization/hooks/ 5 hooks: 6 # generate the swagger.yaml file using go-swagger and bundle it into the assets directory 7 - swagger generate spec --scan-models --exclude-deps -o web/assets/swagger.yaml 8 - sed -i "s/REPLACE_ME/{{ incpatch .Version }}/" web/assets/swagger.yaml 9 # bundle web assets 10 - yarn install --cwd web/source 11 - scripts/bundle.sh 12 builds: 13 # https://goreleaser.com/customization/build/ 14 - 15 main: ./cmd/gotosocial 16 binary: gotosocial 17 ldflags: 18 - -s 19 - -w 20 - -extldflags 21 - -static 22 - -X main.Version={{.Version}} 23 tags: 24 - netgo 25 - osusergo 26 - static_build 27 env: 28 - CGO_ENABLED=0 29 goos: 30 - linux 31 - freebsd 32 goarch: 33 - 386 34 - amd64 35 - arm 36 - arm64 37 goarm: 38 - 6 39 - 7 40 ignore: 41 # build freebsd only for amd64 42 - goos: freebsd 43 goarch: arm64 44 - goos: freebsd 45 goarch: arm 46 - goos: freebsd 47 goarch: 386 48 mod_timestamp: "{{ .CommitTimestamp }}" 49 dockers: 50 # https://goreleaser.com/customization/docker/ 51 - 52 use: buildx 53 goos: linux 54 goarch: amd64 55 image_templates: 56 - "superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-amd64" 57 - "superseriousbusiness/{{ .ProjectName }}:latest-amd64" 58 - "superseriousbusiness/{{ .ProjectName }}:snapshot-amd64" 59 build_flag_templates: 60 - "--platform=linux/amd64" 61 - "--label=org.opencontainers.image.created={{.Date}}" 62 - "--label=org.opencontainers.image.title={{.ProjectName}}" 63 - "--label=org.opencontainers.image.revision={{.FullCommit}}" 64 - "--label=org.opencontainers.image.version={{.Version}}" 65 extra_files: 66 - web 67 - go.mod 68 - go.sum 69 - cmd 70 - internal 71 - 72 use: buildx 73 goos: linux 74 goarch: arm64 75 image_templates: 76 - "superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-arm64v8" 77 - "superseriousbusiness/{{ .ProjectName }}:latest-arm64v8" 78 - "superseriousbusiness/{{ .ProjectName }}:snapshot-arm64v8" 79 build_flag_templates: 80 - "--platform=linux/arm64/v8" 81 - "--label=org.opencontainers.image.created={{.Date}}" 82 - "--label=org.opencontainers.image.title={{.ProjectName}}" 83 - "--label=org.opencontainers.image.revision={{.FullCommit}}" 84 - "--label=org.opencontainers.image.version={{.Version}}" 85 extra_files: 86 - web 87 - go.mod 88 - go.sum 89 - cmd 90 - internal 91 - 92 use: buildx 93 goos: linux 94 goarch: arm 95 goarm: 6 96 image_templates: 97 - "superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-armv6" 98 - "superseriousbusiness/{{ .ProjectName }}:latest-armv6" 99 - "superseriousbusiness/{{ .ProjectName }}:snapshot-armv6" 100 build_flag_templates: 101 - "--platform=linux/arm/v6" 102 - "--label=org.opencontainers.image.created={{.Date}}" 103 - "--label=org.opencontainers.image.title={{.ProjectName}}" 104 - "--label=org.opencontainers.image.revision={{.FullCommit}}" 105 - "--label=org.opencontainers.image.version={{.Version}}" 106 extra_files: 107 - web 108 - go.mod 109 - go.sum 110 - cmd 111 - internal 112 - 113 use: buildx 114 goos: linux 115 goarch: arm 116 goarm: 7 117 image_templates: 118 - "superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-armv7" 119 - "superseriousbusiness/{{ .ProjectName }}:latest-armv7" 120 - "superseriousbusiness/{{ .ProjectName }}:snapshot-armv7" 121 build_flag_templates: 122 - "--platform=linux/arm/v7" 123 - "--label=org.opencontainers.image.created={{.Date}}" 124 - "--label=org.opencontainers.image.title={{.ProjectName}}" 125 - "--label=org.opencontainers.image.revision={{.FullCommit}}" 126 - "--label=org.opencontainers.image.version={{.Version}}" 127 extra_files: 128 - web 129 - go.mod 130 - go.sum 131 - cmd 132 - internal 133 docker_manifests: 134 - name_template: superseriousbusiness/{{ .ProjectName }}:{{ .Version }} 135 image_templates: 136 - superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-amd64 137 - superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-arm64v8 138 - superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-armv6 139 - superseriousbusiness/{{ .ProjectName }}:{{ .Version }}-armv7 140 - name_template: superseriousbusiness/{{ .ProjectName }}:latest 141 image_templates: 142 - superseriousbusiness/{{ .ProjectName }}:latest-amd64 143 - superseriousbusiness/{{ .ProjectName }}:latest-arm64v8 144 - superseriousbusiness/{{ .ProjectName }}:latest-armv6 145 - superseriousbusiness/{{ .ProjectName }}:latest-armv7 146 - name_template: superseriousbusiness/{{ .ProjectName }}:snapshot 147 image_templates: 148 - superseriousbusiness/{{ .ProjectName }}:snapshot-amd64 149 - superseriousbusiness/{{ .ProjectName }}:snapshot-arm64v8 150 - superseriousbusiness/{{ .ProjectName }}:snapshot-armv6 151 - superseriousbusiness/{{ .ProjectName }}:snapshot-armv7 152 archives: 153 # https://goreleaser.com/customization/archive/ 154 - 155 id: binary-release 156 files: 157 # standard release files 158 - LICENSE 159 - README.md 160 - CHANGELOG* 161 # web stuff minus source 162 - web/assets 163 - web/template 164 # example config files 165 - example/config.yaml 166 - example/gotosocial.service 167 - 168 id: web-assets 169 files: 170 - LICENSE 171 # just the web stuff minus source 172 - web/assets 173 - web/template 174 meta: true 175 name_template: "{{ .ProjectName }}_{{ .Version }}_web-assets" 176 checksum: 177 # https://goreleaser.com/customization/checksum/ 178 name_template: 'checksums.txt' 179 snapshot: 180 # https://goreleaser.com/customization/snapshots/ 181 name_template: "{{ incpatch .Version }}-SNAPSHOT" 182 source: 183 # https://goreleaser.com/customization/source/ 184 enabled: true 185 name_template: "{{ .ProjectName }}-{{ .Version }}-source-code"