Skip to content

Wails build

Wails build #13

Workflow file for this run

name: Wails build
permissions:
contents: write
on:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
runs-on: windows-latest
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.10.0
- name: Set up Git
run: git config --global user.email "[email protected]" && git config --global user.name "GitHub Actions"
- name: Install pnpm
run: npm install -g pnpm
- name: Extract Version
id: extract_version
shell: bash
run: |
version=$(jq -r '.info.productVersion' ./app/wails.json)
echo "Version extracted from wails.json: $version"
echo "CURRENT_VERSION=$version" >> "$GITHUB_OUTPUT"
- name: Bump Version
id: bump_version
shell: bash
run: |
IFS='.' read -ra version_parts <<< "${{ steps.extract_version.outputs.CURRENT_VERSION }}"
major="${version_parts[0]}"
minor="${version_parts[1]}"
patch="${version_parts[2]}"
patch=$((patch + 1))
new_version="$major.$minor.$patch"
echo "Bumped version to: $new_version"
echo "BUILD_VERSION=$new_version" >> "$GITHUB_OUTPUT"
jq --arg new_version "$new_version" '.info.productVersion = $new_version' ./app/wails.json > temp_wails.json
mv temp_wails.json ./app/wails.json
jq --arg new_version "$new_version" '.productVersion = $new_version' ./server/server.json > temp_wails.json
mv temp_wails.json ./server/server.json
- name: Commit and Push bump
run: |
git add ./app/wails.json
git add ./server/server.json
git commit -m "Bump version to v${{ steps.bump_version.outputs.BUILD_VERSION }}"
git push
- name: Setup GoLang
uses: actions/setup-go@v4
with:
check-latest: true
go-version: 1.21.3
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/[email protected]
shell: bash
- name: Build Windows App
working-directory: ./app
run: wails build --clean --platform windows/amd64 -o PalworldDSGui.exe
shell: bash
- name: Build Windows Server
working-directory: ./server
run: go build -o PalworldDSGUI_WinServer.exe
shell: bash
# - name: Build Linux Server
# working-directory: ./server
# run: GOOS=linux GOARCH=amd64 go build -o PalworldDSGUI_LinuxServer
# shell: bash
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: PalworldDSGui.exe
path: |
./app/build/bin/PalworldDSGui.exe
./server/PalworldDSGUI_WinServer.exe
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
./app/build/bin/PalworldDSGui.exe
./server/PalworldDSGUI_WinServer.exe
tag_name: v${{ steps.bump_version.outputs.BUILD_VERSION }}
name: Release v${{ steps.bump_version.outputs.BUILD_VERSION }}
draft: true
body: |
## Changelog
No changelog available yet.