checksum and compress

This commit is contained in:
techknowlogick 2023-03-18 01:58:21 -04:00
parent 4d868b7f3c
commit 9eb8b08a69
2 changed files with 29 additions and 6 deletions

12
.goreleaser.checksum.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -e
if [ -z "$1" ]; then
echo "usage: $0 <path>"
exit 1
fi
SUM=$(shasum -a 256 "$1" | cut -d' ' -f1)
BASENAME=$(basename "$1")
echo -n "${SUM} ${BASENAME}" > "$1".sha256

View File

@ -14,8 +14,6 @@ builds:
- amd64 - amd64
- arm - arm
- arm64 - arm64
# - s390x
# - ppc64le
goarm: goarm:
- "5" - "5"
- "6" - "6"
@ -63,8 +61,7 @@ builds:
- -s -w -X gitea.com/gitea/act_runner/cmd.version={{ .Version }} - -s -w -X gitea.com/gitea/act_runner/cmd.version={{ .Version }}
binary: >- binary: >-
{{ .ProjectName }}- {{ .ProjectName }}-
{{- if .IsSnapshot }}{{ .Branch }}- {{- .Version }}-
{{- else }}{{- .Version }}-{{ end }}
{{- .Os }}- {{- .Os }}-
{{- if eq .Arch "amd64" }}amd64 {{- if eq .Arch "amd64" }}amd64
{{- else if eq .Arch "amd64_v1" }}amd64 {{- else if eq .Arch "amd64_v1" }}amd64
@ -72,6 +69,13 @@ builds:
{{- else }}{{ .Arch }}{{ end }} {{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}-{{ .Arm }}{{ end }} {{- if .Arm }}-{{ .Arm }}{{ end }}
no_unique_dist_dir: true no_unique_dist_dir: true
hooks:
post:
- cmd: tar -cJf {{ .Path }}.xz {{ .Path }}
env:
- XZ_OPT=-9
- cmd: sh .goreleaser.checksum.sh {{ .Path }}
- cmd: sh .goreleaser.checksum.sh {{ .Path }}.xz
blobs: blobs:
- -
@ -79,6 +83,9 @@ blobs:
bucket: "{{ .Env.S3_BUCKET }}" bucket: "{{ .Env.S3_BUCKET }}"
region: "{{ .Env.S3_REGION }}" region: "{{ .Env.S3_REGION }}"
folder: "act_runner/{{.Version}}" folder: "act_runner/{{.Version}}"
extra_files:
- glob: ./**.xz
- glob: ./**.sha256
archives: archives:
- format: binary - format: binary
@ -87,10 +94,14 @@ archives:
checksum: checksum:
name_template: 'checksums.txt' name_template: 'checksums.txt'
extra_files:
- glob: ./**.xz
snapshot: snapshot:
name_template: "{{ incpatch .Version }}" name_template: "{{ .Branch }}-devel"
nightly: nightly:
publish_release: false
name_template: "{{ .Branch }}" name_template: "{{ .Branch }}"
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj