refactor: remove commented build steps and add checksum script for binaries
This commit is contained in:
@@ -33,26 +33,6 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: go test -race -v -shuffle=on ./...
|
run: go test -race -v -shuffle=on ./...
|
||||||
|
|
||||||
# - name: Build for linux
|
|
||||||
# run: |
|
|
||||||
# go build -o bin/SteamCache2-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH} main.go
|
|
||||||
# env:
|
|
||||||
# VERSION: ${{github.ref_name}}
|
|
||||||
# BUILD: ${{github.run_number}}
|
|
||||||
# GOOS: linux
|
|
||||||
# GOARCH: amd64
|
|
||||||
# EXE: ""
|
|
||||||
|
|
||||||
# - name: Build for windows
|
|
||||||
# run: |
|
|
||||||
# go build -o bin/SteamCache2-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH} main.go
|
|
||||||
# env:
|
|
||||||
# VERSION: ${{github.ref_name}}
|
|
||||||
# BUILD: ${{github.run_number}}
|
|
||||||
# GOOS: windows
|
|
||||||
# GOARCH: amd64
|
|
||||||
# EXE: ".exe"
|
|
||||||
|
|
||||||
- name: Release binaries
|
- name: Release binaries
|
||||||
uses: goreleaser/goreleaser-action@v6
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
|
|||||||
12
.goreleaser.checksum.sh
Normal file
12
.goreleaser.checksum.sh
Normal 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
|
||||||
59
.goreleaser.yaml
Normal file
59
.goreleaser.yaml
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
|
||||||
|
builds:
|
||||||
|
- env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.Version={{ .Version }}
|
||||||
|
binary: >-
|
||||||
|
{{ .ProjectName }}-
|
||||||
|
{{- .Version }}-
|
||||||
|
{{- .Os }}-
|
||||||
|
{{- if eq .Arch "amd64" }}amd64
|
||||||
|
{{- else if eq .Arch "amd64_v1" }}amd64
|
||||||
|
{{- else if eq .Arch "386" }}386
|
||||||
|
{{- else }}{{ .Arch }}{{ end }}
|
||||||
|
{{- if .Arm }}-{{ .Arm }}{{ end }}
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
hooks:
|
||||||
|
post:
|
||||||
|
- cmd: xz -k -9 {{ .Path }}
|
||||||
|
dir: ./dist/
|
||||||
|
- cmd: sh .goreleaser.checksum.sh {{ .Path }}
|
||||||
|
- cmd: sh .goreleaser.checksum.sh {{ .Path }}.xz
|
||||||
|
|
||||||
|
archives:
|
||||||
|
- format: binary
|
||||||
|
name_template: "{{ .Binary }}"
|
||||||
|
allow_different_binary_count: true
|
||||||
|
|
||||||
|
checksum:
|
||||||
|
name_template: 'checksums.txt'
|
||||||
|
extra_files:
|
||||||
|
- glob: ./**.xz
|
||||||
|
|
||||||
|
force_token: gitea
|
||||||
|
|
||||||
|
snapshot:
|
||||||
|
name_template: "{{ .Branch }}-devel"
|
||||||
|
|
||||||
|
nightly:
|
||||||
|
name_template: "{{ .Branch }}"
|
||||||
|
|
||||||
|
gitea_urls:
|
||||||
|
api: https://gitea.s1d3sw1ped.com/api/v1
|
||||||
|
download: https://gitea.s1d3sw1ped.com
|
||||||
|
|
||||||
|
release:
|
||||||
|
extra_files:
|
||||||
|
- glob: ./**.xz
|
||||||
|
- glob: ./**.xz.sha256
|
||||||
Reference in New Issue
Block a user