diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 0000000..03e5bc2 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,71 @@ +name: Build Linux + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + build-linux: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.24" + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + pkg-config \ + libgtk-3-dev \ + libwebkit2gtk-4.0-dev \ + libasound2-dev \ + libayatana-appindicator3-dev + + - name: Install Wails CLI + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + + - name: Install frontend dependencies + run: npm install + working-directory: frontend + + - name: Determine version + id: version + run: | + if [ -f scripts/VERSION ]; then + VERSION=$(head -n1 scripts/VERSION | tr -d '\r\n' | xargs) + fi + if [ -z "$VERSION" ]; then + VERSION="dev" + fi + echo "app_version=$VERSION" >> "$GITHUB_OUTPUT" + + - name: Fix npm bin permissions + run: chmod +x frontend/node_modules/.bin/* 2>/dev/null || true + + - name: Build app + run: | + WAILS_WEBKIT_TAGS="" + if pkg-config --exists webkit2gtk-4.1 2>/dev/null; then + WAILS_WEBKIT_TAGS="-tags webkit2_41" + fi + wails build -platform linux/amd64 -clean $WAILS_WEBKIT_TAGS -ldflags "-X main.AppVersion=${{ steps.version.outputs.app_version }}" + + - name: Upload binary + uses: actions/upload-artifact@v4 + with: + name: wis-free-v3-linux-amd64 + path: build/bin/wis-free-v3 \ No newline at end of file