name: Release Builds on: push: tags: - "v*" workflow_dispatch: permissions: contents: write jobs: build: name: Build ${{ matrix.platform }} runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: include: - platform: darwin/amd64 runner: macos-13 os: darwin arch: amd64 archive_type: zip - platform: darwin/arm64 runner: macos-14 os: darwin arch: arm64 archive_type: zip - platform: linux/amd64 runner: ubuntu-latest os: linux arch: amd64 archive_type: tar - platform: linux/arm64 runner: ubuntu-24.04-arm64 os: linux arch: arm64 archive_type: tar - platform: windows/amd64 runner: windows-latest os: windows arch: amd64 archive_type: zip - platform: windows/arm64 runner: ubuntu-latest os: windows arch: arm64 archive_type: zip cross: true steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Set up Node uses: actions/setup-node@v4 with: node-version: "20" - name: Install Wails run: go install github.com/wailsapp/wails/v2/cmd/wails@$(go list -m -f '{{.Version}}' github.com/wailsapp/wails/v2) - name: Install frontend dependencies run: npm ci working-directory: frontend - name: Install Linux build dependencies if: matrix.os == 'linux' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev - name: Install Windows cross-compiler if: matrix.os == 'windows' && matrix.cross run: | sudo apt-get update sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-aarch64 zip - name: Build (non-Windows runners) if: matrix.runner != 'windows-latest' env: CGO_ENABLED: "1" run: | if [ "${{ matrix.os }}" = "windows" ] && [ "${{ matrix.cross }}" = "true" ]; then export CC=aarch64-w64-mingw32-gcc fi wails build -platform "${{ matrix.platform }}" -ldflags "-s -w" - name: Build (Windows runner) if: matrix.runner == 'windows-latest' shell: pwsh env: CGO_ENABLED: "1" run: | wails build -platform "${{ matrix.platform }}" -ldflags "-s -w" - name: Package (zip) if: matrix.archive_type == 'zip' && matrix.runner != 'windows-latest' run: | archive="nexus-terminal-${{ matrix.platform }}.zip" cd build/bin zip -r "../../${archive}" . - name: Package (tar) if: matrix.archive_type == 'tar' run: | archive="nexus-terminal-${{ matrix.platform }}.tar.gz" tar -czf "${archive}" -C build/bin . - name: Package (Windows zip) if: matrix.archive_type == 'zip' && matrix.runner == 'windows-latest' shell: pwsh run: | $archive = "nexus-terminal-${{ matrix.platform }}.zip" Compress-Archive -Path "build/bin/*" -DestinationPath $archive - name: Upload artifact uses: actions/upload-artifact@v4 with: name: nexus-terminal-${{ matrix.platform }} path: | nexus-terminal-${{ matrix.platform }}.zip nexus-terminal-${{ matrix.platform }}.tar.gz - name: Attach to GitHub Release if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: files: | nexus-terminal-${{ matrix.platform }}.zip nexus-terminal-${{ matrix.platform }}.tar.gz