From c4ac22577fd2ba62b4f6065416b0db3641b9a1b8 Mon Sep 17 00:00:00 2001 From: zarazaex69 Date: Mon, 13 Apr 2026 12:10:50 +0300 Subject: [PATCH] feat: add CI workflow for linting and building CLI, UI, and Android artifacts --- .github/workflows/ci.yml | 114 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..027df65 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,114 @@ +name: CI + +on: + push: + branches: [ "main", "master" ] + pull_request: + branches: [ "main", "master" ] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25.x' + + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest + args: --timeout=5m + + build-cli: + name: Build CLI (Binaries) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25.x' + + - name: Install Mage + run: go install github.com/magefile/mage@latest + + - name: Build CLI (Cross) + run: mage cross + + - name: Upload CLI Artifacts + uses: actions/upload-artifact@v4 + with: + name: olcrtc-cli-binaries + path: build/ + + build-ui: + name: Build UI (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25.x' + + - name: Install Linux Dependencies (Fyne) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev libwayland-dev libx11-dev + + - name: Install Mage + run: go install github.com/magefile/mage@latest + + - name: Build UI + run: mage buildUI + + - name: Upload UI Artifact + uses: actions/upload-artifact@v4 + with: + name: olcrtc-ui-${{ runner.os }} + path: build/ + + build-android: + name: Build Android (AAR) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25.x' + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Install gomobile + run: | + go install golang.org/x/mobile/cmd/gomobile@latest + gomobile init + + - name: Install Mage + run: go install github.com/magefile/mage@latest + + - name: Build Mobile + run: mage mobile + + - name: Upload Android Artifact + uses: actions/upload-artifact@v4 + with: + name: olcrtc-android + path: build/olcrtc.aar