4040 go-version-file : go.mod
4141 cache : false
4242
43- - name : Build binary and package
43+ - name : Build binary
4444 env :
4545 GOOS : ${{ matrix.goos }}
4646 GOARCH : ${{ matrix.goarch }}
@@ -50,28 +50,16 @@ jobs:
5050
5151 mkdir -p dist
5252
53- BIN_NAME="sops-cop "
53+ BIN_NAME="sops-cop_${VERSION}_${GOOS}_${GOARCH} "
5454 if [[ "$GOOS" == "windows" ]]; then
5555 BIN_NAME="${BIN_NAME}.exe"
5656 fi
5757
58- TARGET_DIR="sops-cop_${VERSION}_${GOOS}_${GOARCH}"
59- mkdir -p "$TARGET_DIR"
60-
6158 CGO_ENABLED=0 GOOS="$GOOS" GOARCH="$GOARCH" go build -trimpath \
6259 -ldflags="-s -w -X main.version=${VERSION}" \
63- -o "$TARGET_DIR/$BIN_NAME" .
64- cp README.md "$TARGET_DIR/README.md"
65-
66- if [[ "$GOOS" == "windows" ]]; then
67- ARCHIVE="${TARGET_DIR}.zip"
68- zip -r "dist/$ARCHIVE" "$TARGET_DIR"
69- else
70- ARCHIVE="${TARGET_DIR}.tar.gz"
71- tar -czf "dist/$ARCHIVE" "$TARGET_DIR"
72- fi
60+ -o "dist/$BIN_NAME" .
7361
74- - name : Upload packaged artifact
62+ - name : Upload artifact
7563 uses : actions/upload-artifact@v4
7664 with :
7765 name : sops-cop-${{ matrix.goos }}-${{ matrix.goarch }}
@@ -93,14 +81,12 @@ jobs:
9381 run : |
9482 set -euo pipefail
9583 cd dist
96- shopt -s nullglob
97- shasum -a 256 *.tar.gz *.zip > checksums.txt
84+ shasum -a 256 sops-cop_* > checksums.txt
9885
9986 - name : Create GitHub release
10087 uses : softprops/action-gh-release@v2
10188 with :
10289 files : |
103- dist/*.tar.gz
104- dist/*.zip
90+ dist/sops-cop_*
10591 dist/checksums.txt
10692 generate_release_notes : true
0 commit comments