Skip to content

fix: improve translation type guards to prevent misidentification #13

fix: improve translation type guards to prevent misidentification

fix: improve translation type guards to prevent misidentification #13

Workflow file for this run

name: Wails Build
on:
push:
tags:
- v*.*.*
workflow_dispatch:
inputs:
tag:
description: "Tag to release"
required: true
jobs:
build:
strategy:
fail-fast: false
matrix:
build: [
{
name: "Windows-amd64",
platform: windows/amd64,
os: windows-latest,
},
# { name: "Linux-amd64", platform: linux/amd64, os: ubuntu-latest },
# {
# name: "MacOS-universal",
# platform: darwin/universal,
# os: macos-latest,
# },
]
runs-on: ${{ matrix.build.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Get version from tag
id: get_version
shell: bash
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
elif [[ -n "${{ github.event.inputs.tag }}" ]]; then
VERSION=${{ github.event.inputs.tag }}
VERSION=${VERSION#v}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "VERSION=dev" >> $GITHUB_ENV
fi
echo "Version: ${VERSION}"
- name: Update version in files
shell: bash
run: |
sed -i "s/const Version = \".*\"/const Version = \"${{ env.VERSION }}\"/" backend/app/app.go
sed -i "s/\"productVersion\": \".*\"/\"productVersion\": \"${{ env.VERSION }}\"/" wails.json
echo "Updated version to ${{ env.VERSION }} in files:"
grep "const Version" backend/app/app.go
grep "productVersion" wails.json
- name: Build Wails app
uses: dAppServer/wails-build-action@main
with:
build-name: "DaCapo.exe"
build-platform: ${{ matrix.build.platform }}
wails-version: v2.9.2
go-version: 1.23
node-version: 22.11
nsis: true
package: false
- name: Debug
run: |
dir build/bin
- name: Prepare release
run: |
mkdir -p DaCapo
mv build/bin/DaCapo.exe DaCapo/
powershell Compress-Archive -Path DaCapo -DestinationPath DaCapo-v${{ env.VERSION }}-${{ matrix.build.name }}-portable.zip
mv build/bin/DaCapo-amd64-installer.exe DaCapo-v${{ env.VERSION }}-${{ matrix.build.name }}-installer.exe
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
name: ${{ github.event.inputs.tag || github.ref_name }}
body: |
仅支持Windows10/11,需自行安装python环境。
Only supports Windows 10/11. Python environment needs to be installed separately.
files: |
DaCapo-v${{ env.VERSION }}-${{ matrix.build.name }}-portable.zip
DaCapo-v${{ env.VERSION }}-${{ matrix.build.name }}-installer.exe