[DEPRECATED] Go implementation of plcbundle

update goreleaser

+23 -49
+3 -21
.goreleaser.yml
··· 1 1 version: 2 2 2 3 - project_name: plcbundle 4 - 5 - before: 6 - hooks: 7 - - go mod tidy 8 - - go test ./... 9 - 10 3 builds: 11 - - id: plcbundle 12 - main: ./cmd/plcbundle 4 + - main: ./cmd/plcbundle 13 5 binary: plcbundle 14 6 env: 15 7 - CGO_ENABLED=1 16 - # Only build for current platform locally 17 - goos: 18 - - darwin 19 - goarch: 20 - - arm64 8 + goos: [linux] 9 + goarch: [amd64, arm64] 21 10 ldflags: 22 11 - -s -w 23 12 - -X main.version={{.Version}} 24 - - -X main.gitCommit={{.ShortCommit}} 25 - - -X main.buildDate={{.Date}} 26 13 27 14 archives: 28 15 - formats: ["tar.gz"] 29 - name_template: >- 30 - {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }} 31 - 32 - checksum: 33 - name_template: 'checksums.txt' 34 16 35 17 release: 36 18 disable: true
+10 -8
.tangled/workflows/build.yml
··· 9 9 dependencies: 10 10 nixpkgs: 11 11 - go 12 - - goreleaser 12 + - gcc 13 + - git 14 + - zstd 15 + - zstd.dev 13 16 14 17 environment: 15 - CGO_ENABLED: "0" 18 + CGO_ENABLED: "1" 19 + GOPATH: "/workspace/go" 16 20 17 21 steps: 18 22 - name: "Download dependencies" ··· 24 28 command: | 25 29 go test -v ./... 26 30 27 - - name: "Build snapshot (test cross-compilation)" 31 + - name: "Build binary" 28 32 command: | 29 - goreleaser build --snapshot --clean 30 - 31 - - name: "Show artifacts" 32 - command: | 33 - ls -lh dist/ 33 + go build -o plcbundle ./cmd/plcbundle 34 + ./plcbundle version 35 + echo "✓ Build successful"
+10 -20
.tangled/workflows/release.yml
··· 10 10 dependencies: 11 11 nixpkgs: 12 12 - go 13 + - goreleaser 13 14 - gcc 14 - - gnumake 15 - - zstd 16 15 - git 16 + - zstd 17 + - zstd.dev 17 18 18 - steps: 19 - - name: "Build Linux binaries (native with CGO)" 20 - command: | 21 - # Build for current platform (Linux) 22 - CGO_ENABLED=1 go build \ 23 - -ldflags="-s -w -X main.version=$(git describe --tags --always) -X main.gitCommit=$(git rev-parse --short HEAD)" \ 24 - -o dist/plcbundle_linux_amd64/plcbundle \ 25 - ./cmd/plcbundle 26 - 27 - echo "✓ Linux binary built:" 28 - ls -lh dist/plcbundle_linux_amd64/plcbundle 19 + environment: 20 + CGO_ENABLED: "1" 29 21 30 - - name: "Create archive" 22 + steps: 23 + - name: "Build with GoReleaser" 31 24 command: | 32 - cd dist 33 - tar -czf plcbundle_$(git describe --tags)_linux_amd64.tar.gz plcbundle_linux_amd64/ 34 - sha256sum *.tar.gz > checksums.txt 35 - 36 - echo "✓ Artifacts:" 37 - ls -lh *.tar.gz checksums.txt 25 + goreleaser build --clean 26 + echo "✓ Binaries built:" 27 + ls -lh dist/*/plcbundle