Skip to content

Commit 4627a1d

Browse files
committed
feat: support ci feature flags build
1 parent 412feb8 commit 4627a1d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/build-release.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,22 @@ jobs:
4444
with:
4545
go-version: "1.22.6"
4646

47+
- name: Read enabled flags
48+
run: |
49+
ENABLED_FLAGS=$(cat enabled_flags.txt)
50+
echo "Enabled flags: $ENABLED_FLAGS"
51+
echo "ENABLED_FLAGS=$ENABLED_FLAGS" >> $GITHUB_ENV
52+
4753
- name: Build binary
54+
env:
55+
ENABLED_FLAGS: ${{ env.ENABLED_FLAGS }}
4856
run: |
4957
mkdir -p build/${{ matrix.goos }}_${{ matrix.goarch }}
50-
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/${{ matrix.goos }}_${{ matrix.goarch }}/weave
58+
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags "-X github.com/initia-labs/weave/cmd.Version=${{ github.ref_name }} -X github.com/initia-labs/weave/flags.EnabledFlags=${{ env.ENABLED_FLAGS }}" -o build/${{ matrix.goos }}_${{ matrix.goarch }}/weave
5159
5260
- name: List files in build directory (optional for debugging)
5361
run: ls -R build/
5462

55-
# tar.gz
5663
- name: Create tar.gz
5764
run: |
5865
tar -czvf weave_${{ github.ref_name }}_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz -C build/${{ matrix.goos }}_${{ matrix.goarch }} weave

enabled_flags.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
minitia_launch

0 commit comments

Comments
 (0)