feat(console): style the text-mode prompt bar #3344
This file contains hidden or 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
| # Copyright 2023 LiveKit, Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Linux + Windows are cross-compiled with zig on a (cheap) Linux runner. | |
| cross-build: | |
| name: Cross-build linux+windows (zig) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| submodules: true | |
| - name: Set up Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install Zig | |
| uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 | |
| with: | |
| version: 0.14.1 | |
| - name: Cache cross-compile inputs | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 | |
| with: | |
| path: .cross | |
| key: cross-${{ runner.os }}-zig0.14.1-alsa1.2.12-${{ hashFiles('scripts/setup-cross.sh') }} | |
| - name: GoReleaser snapshot build | |
| uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| # darwin is excluded here — it can't be cross-compiled from Linux | |
| # (no macOS SDK/CoreAudio); it builds natively in the macos job below. | |
| args: >- | |
| build --snapshot --clean | |
| --id lk-linux-amd64 --id lk-linux-arm64 | |
| --id lk-windows-amd64 --id lk-windows-arm64 | |
| env: | |
| # goreleaser-action runs goreleaser via a Node wrapper that doesn't | |
| # forward PWD; the .goreleaser.yaml CGO flags template {{ .Env.PWD }} | |
| # to locate .cross/<target>. Provide it explicitly. | |
| PWD: ${{ github.workspace }} | |
| - name: Verify linux binary runs | |
| run: | | |
| binary=$(find dist -type f -name lk -path '*linux*amd64*' | head -n1) | |
| test -n "$binary" || { echo "no linux/amd64 binary in dist/"; exit 1; } | |
| # Static-libgcc/libstdc++ binary should run on glibc 2.28+ Ubuntu runners. | |
| "$binary" --help > /dev/null | |
| # darwin builds natively on macOS — its cgo links the CoreAudio frameworks, | |
| # which only exist on a Mac. No zig needed. | |
| build-darwin: | |
| name: Build darwin (native) | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| submodules: true | |
| - name: Set up Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build and verify | |
| run: | | |
| # arm64 native — build and run. | |
| CGO_ENABLED=1 go build -o /tmp/lk ./cmd/lk | |
| /tmp/lk --help > /dev/null | |
| # amd64 (Intel) cross — Apple clang targets x86_64 from arm64; compile | |
| # only (can't run an x86_64 binary on the arm64 runner). | |
| CGO_ENABLED=1 GOARCH=amd64 go build -o /tmp/lk-amd64 ./cmd/lk |