tangled
alpha
login
or
join now
atscan.net
/
plcbundle-go
1
fork
atom
[DEPRECATED] Go implementation of plcbundle
1
fork
atom
overview
issues
pulls
pipelines
update goreleaser
tree.fail
4 months ago
afa27df4
0a93b6e3
+23
-49
3 changed files
expand all
collapse all
unified
split
.goreleaser.yml
.tangled
workflows
build.yml
release.yml
+3
-21
.goreleaser.yml
···
1
1
version: 2
2
2
3
3
-
project_name: plcbundle
4
4
-
5
5
-
before:
6
6
-
hooks:
7
7
-
- go mod tidy
8
8
-
- go test ./...
9
9
-
10
3
builds:
11
11
-
- id: plcbundle
12
12
-
main: ./cmd/plcbundle
4
4
+
- main: ./cmd/plcbundle
13
5
binary: plcbundle
14
6
env:
15
7
- CGO_ENABLED=1
16
16
-
# Only build for current platform locally
17
17
-
goos:
18
18
-
- darwin
19
19
-
goarch:
20
20
-
- arm64
8
8
+
goos: [linux]
9
9
+
goarch: [amd64, arm64]
21
10
ldflags:
22
11
- -s -w
23
12
- -X main.version={{.Version}}
24
24
-
- -X main.gitCommit={{.ShortCommit}}
25
25
-
- -X main.buildDate={{.Date}}
26
13
27
14
archives:
28
15
- formats: ["tar.gz"]
29
29
-
name_template: >-
30
30
-
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
31
31
-
32
32
-
checksum:
33
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
12
-
- goreleaser
12
12
+
- gcc
13
13
+
- git
14
14
+
- zstd
15
15
+
- zstd.dev
13
16
14
17
environment:
15
15
-
CGO_ENABLED: "0"
18
18
+
CGO_ENABLED: "1"
19
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
27
-
- name: "Build snapshot (test cross-compilation)"
31
31
+
- name: "Build binary"
28
32
command: |
29
29
-
goreleaser build --snapshot --clean
30
30
-
31
31
-
- name: "Show artifacts"
32
32
-
command: |
33
33
-
ls -lh dist/
33
33
+
go build -o plcbundle ./cmd/plcbundle
34
34
+
./plcbundle version
35
35
+
echo "✓ Build successful"
+10
-20
.tangled/workflows/release.yml
···
10
10
dependencies:
11
11
nixpkgs:
12
12
- go
13
13
+
- goreleaser
13
14
- gcc
14
14
-
- gnumake
15
15
-
- zstd
16
15
- git
16
16
+
- zstd
17
17
+
- zstd.dev
17
18
18
18
-
steps:
19
19
-
- name: "Build Linux binaries (native with CGO)"
20
20
-
command: |
21
21
-
# Build for current platform (Linux)
22
22
-
CGO_ENABLED=1 go build \
23
23
-
-ldflags="-s -w -X main.version=$(git describe --tags --always) -X main.gitCommit=$(git rev-parse --short HEAD)" \
24
24
-
-o dist/plcbundle_linux_amd64/plcbundle \
25
25
-
./cmd/plcbundle
26
26
-
27
27
-
echo "✓ Linux binary built:"
28
28
-
ls -lh dist/plcbundle_linux_amd64/plcbundle
19
19
+
environment:
20
20
+
CGO_ENABLED: "1"
29
21
30
30
-
- name: "Create archive"
22
22
+
steps:
23
23
+
- name: "Build with GoReleaser"
31
24
command: |
32
32
-
cd dist
33
33
-
tar -czf plcbundle_$(git describe --tags)_linux_amd64.tar.gz plcbundle_linux_amd64/
34
34
-
sha256sum *.tar.gz > checksums.txt
35
35
-
36
36
-
echo "✓ Artifacts:"
37
37
-
ls -lh *.tar.gz checksums.txt
25
25
+
goreleaser build --clean
26
26
+
echo "✓ Binaries built:"
27
27
+
ls -lh dist/*/plcbundle