name: CI on: push: branches: [ "main" ] pull_request: branches: [ "main" ] workflow_dispatch: jobs: build: name: Build Rolens strategy: fail-fast: false matrix: platform: [windows-2022, macos-12, ubuntu-22.04] go-version: [1.18] node-version: [16] runs-on: ${{ matrix.platform }} steps: - name: Checkout uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} cache-dependency-path: go.sum - name: Install Wails run: go install github.com/wailsapp/wails/v2/cmd/wails@latest - name: Install Wails dependencies for Linux if: matrix.platform == 'ubuntu-22.04' run: sudo apt-get install gtk+-3.0 webkit2gtk-4.0 - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: npm cache-dependency-path: frontend/package-lock.json - name: Cross-compile Rolens for Windows run: | mkdir releases wails build -platform windows/amd64 tar -czvf releases\rolens-${{ matrix.platform }}-amd64.tar.gz --directory build\bin Rolens.exe rmdir build\bin wails build -platform windows/arm64 tar -czvf releases\rolens-${{ matrix.platform }}-arm64.tar.gz --directory build\bin Rolens.exe - name: Cross-compile Rolens for Darwin run: | mkdir releases wails build -platform darwin/amd64 tar -czvf releases/rolens-${{ matrix.platform }}-amd64.tar.gz --directory build/bin Rolens.app rm -rf build/bin wails build -platform darwin/arm64 tar -czvf releases/rolens-${{ matrix.platform }}-arm64.tar.gz --directory build/bin Rolens.app - name: Cross-compile Rolens for Linux run: | mkdir releases wails build -platform darwin/amd64 tar -czvf releases/rolens-${{ matrix.platform }}-amd64.tar.gz --directory build/bin Rolens rm -rf build/bin wails build -platform windows/arm64 tar -czvf releases/rolens-${{ matrix.platform }}-arm64.tar.gz --directory build/bin Rolens - name: Upload generated amd64 binary uses: actions/upload-artifact@v2 with: name: rolens-${{ matrix.platform }}-amd64 path: releases/rolens-${{ matrix.platform }}-amd64.tar.gz - name: Upload generated arm64 binary uses: actions/upload-artifact@v2 with: name: rolens-${{ matrix.platform }}-arm64 path: releases/rolens-${{ matrix.platform }}-arm64.tar.gz