Skip to content

Commit a1da009

Browse files
authored
CI: include license in released zip bundle (#849)
1 parent caca26c commit a1da009

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.github/workflows/build.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,28 @@ jobs:
130130
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
131131
with:
132132
go-version-file: .go-version
133-
- name: Build
133+
- name: Build binary
134+
id: build-binary
134135
env:
135136
GOOS: "linux"
136137
GOARCH: ${{ matrix.arch }}
137138
VERSION: ${{ needs.get-product-version.outputs.product-version }}
138139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140+
shell: bash
139141
run: |
140-
mkdir dist out
141-
make ci-build
142-
zip -r -j out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip dist/${{ env.GOOS }}/${{ env.GOARCH }}/${{ env.PKG_NAME }}
143-
- name: Upload binaries
142+
BUILD_DIR=dist
143+
make ci-build BUILD_DIR="${BUILD_DIR}"
144+
OUT_DIR="${BUILD_DIR}/out"
145+
mkdir -p "${OUT_DIR}"
146+
ZIP_FILE="${OUT_DIR}/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip"
147+
zip -r -j "${ZIP_FILE}" dist/${{ env.GOOS }}/${{ env.GOARCH }}/${{ env.PKG_NAME }} LICENSE
148+
echo "path=${ZIP_FILE}" >> $GITHUB_OUTPUT
149+
echo "name=$(basename ${ZIP_FILE})" >> $GITHUB_OUTPUT
150+
- name: Upload binary
144151
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
145152
with:
146-
name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip
147-
path: out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip
153+
name: ${{ steps.build-binary.outputs.name }}
154+
path: ${{ steps.build-binary.outputs.path }}
148155

149156
build-docker:
150157
name: Docker ${{ matrix.arch }} build

0 commit comments

Comments
 (0)