From a10fedf2221d7f3e73063fb8d7021684cd6c24d4 Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Tue, 2 Jul 2024 18:04:24 +0300 Subject: [PATCH] build fix --- .github/workflows/release.yaml | 73 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 27c4375..24f3016 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,44 +10,43 @@ jobs: name: Release permissions: contents: write - build: - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - name: Checkout code - uses: actions/checkout@v2 - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Build binary (Unix) - if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' - run: CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o kube-lineage ./cmd/kube-lineage + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + - name: Checkout code + uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Build binary (Unix) + if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' + run: CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o kube-lineage ./cmd/kube-lineage - - name: Build binary (Windows) - if: matrix.os == 'windows-latest' - run: CGO_ENABLED=0 GOOS=windows go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o kube-lineage.exe ./cmd/kube-lineage + - name: Build binary (Windows) + if: matrix.os == 'windows-latest' + run: CGO_ENABLED=0 GOOS=windows go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o kube-lineage.exe ./cmd/kube-lineage - - name: Zip the application (Unix) - if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' - run: | - zip -r kube-lineage-${{ matrix.os }}-${{ github.ref_name }}.zip kube-lineage + - name: Zip the application (Unix) + if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' + run: | + zip -r kube-lineage-${{ matrix.os }}-${{ github.ref_name }}.zip kube-lineage - - name: Zip the application (Windows) - if: matrix.os == 'windows-latest' - run: | - Compress-Archive -Path kube-lineage.exe -DestinationPath kube-lineage-${{ matrix.os }}-${{ github.ref_name }}.zip -Force + - name: Zip the application (Windows) + if: matrix.os == 'windows-latest' + run: | + Compress-Archive -Path kube-lineage.exe -DestinationPath kube-lineage-${{ matrix.os }}-${{ github.ref_name }}.zip -Force - - name: Upload Release Asset - uses: actions/upload-artifact@v2 - with: - path: ./kube-lineage-${{ matrix.os }}-${{ github.ref_name }}.zip - name: kube-lineage-${{ matrix.os }}-${{ github.ref_name }}.zip + - name: Upload Release Asset + uses: actions/upload-artifact@v2 + with: + path: ./kube-lineage-${{ matrix.os }}-${{ github.ref_name }}.zip + name: kube-lineage-${{ matrix.os }}-${{ github.ref_name }}.zip