Use macos-15-intel for darwin/amd64 builds #12
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
| name: Build | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| env: | |
| GO_VERSION: '1.25' | |
| NODE_VERSION: '20' | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Install Linux dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev | |
| - name: Install dependencies | |
| run: | | |
| go mod download | |
| cd frontend && npm install | |
| - name: Build frontend | |
| run: cd frontend && npm run build | |
| - name: Run Go tests | |
| run: go test -v ./... | |
| build: | |
| name: Build ${{ matrix.platform }}-${{ matrix.arch }} | |
| needs: test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| platform: windows | |
| arch: amd64 | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: amd64 | |
| - os: macos-15-intel | |
| platform: darwin | |
| arch: amd64 | |
| - os: macos-14 | |
| platform: darwin | |
| arch: arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev imagemagick | |
| - name: Install Wails | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Convert icon to ICO (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| # Install ImageMagick using Chocolatey | |
| choco install imagemagick -y | |
| # Convert PNG to ICO | |
| magick convert build/windows/icon.png -define icon:auto-resize=256,128,64,48,32,16 build/windows/icon.ico | |
| - name: Convert icon to ICNS (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| mkdir -p build/darwin/iconfile.iconset | |
| sips -z 16 16 build/appicon.png --out build/darwin/iconfile.iconset/icon_16x16.png | |
| sips -z 32 32 build/appicon.png --out build/darwin/iconfile.iconset/icon_16x16@2x.png | |
| sips -z 32 32 build/appicon.png --out build/darwin/iconfile.iconset/icon_32x32.png | |
| sips -z 64 64 build/appicon.png --out build/darwin/iconfile.iconset/icon_32x32@2x.png | |
| sips -z 128 128 build/appicon.png --out build/darwin/iconfile.iconset/icon_128x128.png | |
| sips -z 256 256 build/appicon.png --out build/darwin/iconfile.iconset/icon_128x128@2x.png | |
| sips -z 256 256 build/appicon.png --out build/darwin/iconfile.iconset/icon_256x256.png | |
| sips -z 512 512 build/appicon.png --out build/darwin/iconfile.iconset/icon_256x256@2x.png | |
| sips -z 512 512 build/appicon.png --out build/darwin/iconfile.iconset/icon_512x512.png | |
| sips -z 1024 1024 build/appicon.png --out build/darwin/iconfile.iconset/icon_512x512@2x.png | |
| iconutil -c icns build/darwin/iconfile.iconset -o build/darwin/iconfile.icns | |
| - name: Install Frontend Dependencies | |
| shell: bash | |
| run: | | |
| cd frontend | |
| npm install | |
| - name: Build | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.platform }}" == "linux" ]; then | |
| wails build -platform ${{ matrix.platform }}/${{ matrix.arch }} -ldflags "-s -w" -tags webkit2_41 | |
| else | |
| wails build -platform ${{ matrix.platform }}/${{ matrix.arch }} -ldflags "-s -w" | |
| fi | |
| - name: Rename Darwin binary | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| cd build/bin | |
| if [ -d "Go-DLP.app" ]; then | |
| mv Go-DLP.app "Go-DLP_1.0.0_${{ matrix.platform }}_${{ matrix.arch }}.app" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Go-DLP-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: build/bin/ |