143 lines
4.0 KiB
YAML
143 lines
4.0 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
release:
|
|
types: [published]
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
|
|
build_assets:
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.22
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
- name: Get dependencies
|
|
run: |
|
|
go get -v -t -d ./...
|
|
if [ -f Gopkg.toml ]; then
|
|
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
dep ensure
|
|
fi
|
|
- name: Build
|
|
run: |
|
|
chmod +x build.assets.sh
|
|
./build.assets.sh
|
|
- name: Upload
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
freebsd_386_client.tar.gz
|
|
freebsd_386_server.tar.gz
|
|
freebsd_amd64_client.tar.gz
|
|
freebsd_amd64_server.tar.gz
|
|
freebsd_arm_client.tar.gz
|
|
freebsd_arm_server.tar.gz
|
|
linux_386_client.tar.gz
|
|
linux_386_server.tar.gz
|
|
linux_amd64_client.tar.gz
|
|
linux_amd64_server.tar.gz
|
|
linux_arm64_client.tar.gz
|
|
linux_arm64_server.tar.gz
|
|
linux_arm_v5_client.tar.gz
|
|
linux_arm_v6_client.tar.gz
|
|
linux_arm_v7_client.tar.gz
|
|
linux_arm_v5_server.tar.gz
|
|
linux_arm_v6_server.tar.gz
|
|
linux_arm_v7_server.tar.gz
|
|
linux_mips64le_client.tar.gz
|
|
linux_mips64le_server.tar.gz
|
|
linux_mips64_client.tar.gz
|
|
linux_mips64_server.tar.gz
|
|
linux_mipsle_client.tar.gz
|
|
linux_mipsle_server.tar.gz
|
|
linux_mips_client.tar.gz
|
|
linux_mips_server.tar.gz
|
|
darwin_amd64_client.tar.gz
|
|
darwin_amd64_server.tar.gz
|
|
darwin_arm64_client.tar.gz
|
|
darwin_arm64_server.tar.gz
|
|
windows_386_client.tar.gz
|
|
windows_386_server.tar.gz
|
|
windows_amd64_client.tar.gz
|
|
windows_amd64_server.tar.gz
|
|
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 }}
|