diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index 0c00ad2..5560b49 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -73,3 +73,70 @@ jobs: npc_sdk.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build_npc_gui: + + runs-on: ${{ matrix.os }} + needs: build_assets + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux/amd64 + artifact: linux_amd64 + - os: windows-latest + platform: windows/amd64 + artifact: windows_amd64 + - os: macos-latest + platform: darwin/amd64 + artifact: darwin_amd64 + steps: + + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: 1.22 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Enable Yarn (corepack) + run: | + corepack enable + corepack prepare yarn@stable --activate + + - name: Install frontend deps + run: | + cd cmd/npc/npc-gui/frontend + yarn install --frozen-lockfile + + - name: Install Wails CLI + run: | + go install github.com/wailsapp/wails/v2/cmd/wails@latest + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + + - name: Build Wails app + run: | + cd cmd/npc/npc-gui + $(go env GOPATH)/bin/wails build -platform ${{ matrix.platform }} + shell: bash + + - name: Package build output + run: | + cd cmd/npc/npc-gui/build/bin + tar -czvf ../../../npc_gui_${{ matrix.artifact }}.tar.gz ./* + ls -la ../../../npc_gui_${{ matrix.artifact }}.tar.gz + shell: bash + + - name: Upload npc-gui artifact + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: cmd/npc/npc-gui/npc_gui_${{ matrix.artifact }}.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/cmd/npc/npc-gui/build/appicon.png b/cmd/npc/npc-gui/build/appicon.png new file mode 100644 index 0000000..1ed6596 Binary files /dev/null and b/cmd/npc/npc-gui/build/appicon.png differ diff --git a/cmd/npc/npc-gui/frontend/package.json b/cmd/npc/npc-gui/frontend/package.json index 613052a..e8336b3 100644 --- a/cmd/npc/npc-gui/frontend/package.json +++ b/cmd/npc/npc-gui/frontend/package.json @@ -1,5 +1,5 @@ { - "name": "npc-gui", + "name": "npc-client", "type": "module", "version": "1.0.0", "scripts": { diff --git a/cmd/npc/npc-gui/wails.json b/cmd/npc/npc-gui/wails.json index 8579241..b81b14d 100644 --- a/cmd/npc/npc-gui/wails.json +++ b/cmd/npc/npc-gui/wails.json @@ -10,18 +10,19 @@ "dev:serverUrl": "http://localhost:34115" }, "author": { - "name": "NPS Team" + "name": "NPS" }, "info": { "productName": "NPS Client", - "productVersion": "1.0.0", + "productVersion": "0.26.29", "companyName": "NPS", - "copyright": "Copyright © 2024 NPS" + "copyright": "Copyright © 2026 NPS" }, "build": { "nsis": { "oneShotInstaller": true, - "allowToChangeInstallationDirectory": true + "allowToChangeInstallationDirectory": true, + "icon": "build/windows/icon.ico" }, "windows": { "icon": "build/windows/icon.ico"