refactor: simplify jq filter initialization and remove unused libpath #1361
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# every push to a branch: build binary | |
name: Build | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
build_binary: | |
name: Build shell-operator binary | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23" | |
- name: Check out shell-operator code | |
uses: actions/checkout@v4 | |
- name: Restore Go modules | |
id: go-modules-cache | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/go/pkg/mod | |
key: ${{ runner.os }}-gomod-${{ hashFiles('go.mod', 'go.sum') }} | |
- name: Download Go modules | |
if: steps.go-modules-cache.outputs.cache-hit != 'true' | |
run: | | |
go mod download | |
echo -n "Go modules unpacked size is: " && du -sh $HOME/go/pkg/mod | |
- name: Build binary | |
run: | | |
export GOOS=linux | |
go build ./cmd/shell-operator | |
# MacOS build works fine because jq package already has static libraries. | |
# Windows build requires jq compilation, this should be done in libjq-go. | |
# TODO Does cross-compile can help here? | |
# | |
# build_darwin_binary: | |
# name: Darwin binary | |
# runs-on: macos-10.15 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# | |
# - name: install jq | |
# run: | | |
# brew install jq | |
# | |
# - name: build shell-operator binary | |
# run: | | |
# GO111MODULE=on \ | |
# CGO_ENABLED=1 \ | |
# go build ./cmd/shell-operator | |
# | |
# file ./shell-operator | |
# | |
# ./shell-operator version | |
# | |
# build_windows_binary: | |
# name: Windows binary | |
# runs-on: windows-2019 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# | |
# - name: build shell-operator binary | |
# run: | | |
# GO111MODULE=on \ | |
# CGO_ENABLED=1 \ | |
# go build ./cmd/shell-operator | |
# | |
# ls -la . | |
# | |
# ./shell-operator.exe version | |
# shell: bash |