Skip to content

feat: persist instance logs to local files #35

feat: persist instance logs to local files

feat: persist instance logs to local files #35

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-2022,
},
# { 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
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: Get latest two tags
shell: bash
run: |
git fetch --tags --force
mapfile -t TAGS < <(git tag -l "v*" --sort=-version:refname)
CURRENT_TAG="${TAGS[0]}"
PREVIOUS_TAG="${TAGS[1]}"
echo "Current tag: $CURRENT_TAG"
echo "Previous tag: $PREVIOUS_TAG"
echo "COMPARE_URL=https://github.com/Aues6uen11Z/DaCapo/compare/${PREVIOUS_TAG}...${CURRENT_TAG}" >> $GITHUB_ENV
echo "Compare URL: https://github.com/Aues6uen11Z/DaCapo/compare/${PREVIOUS_TAG}...${CURRENT_TAG}"
- 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.11.0
go-version: 1.23
node-version: 22.11
nsis: true
package: false
- name: Prepare release
shell: bash
run: |
mkdir -p DaCapo
cp build/bin/DaCapo.exe DaCapo/
powershell Compress-Archive -Path DaCapo -DestinationPath DaCapo-v${{ env.VERSION }}-${{ matrix.build.name }}-portable.zip
cp build/bin/DaCapo-amd64-installer.exe DaCapo-v${{ env.VERSION }}-${{ matrix.build.name }}-installer.exe
- name: Install selfupdatectl
shell: bash
run: |
echo "Installing selfupdatectl..."
go install github.com/fynelabs/selfupdate/cmd/selfupdatectl@latest
echo "selfupdatectl installed successfully"
- name: Sign application
shell: bash
run: |
echo "Setting up private key..."
echo "${{ secrets.PRIVATE_KEY }}" > ed25519.key
echo "Signing DaCapo.exe..."
selfupdatectl sign DaCapo/DaCapo.exe
echo "Signature created:"
ls -la DaCapo/DaCapo.exe.ed25519
echo "Cleaning up private key..."
rm ed25519.key
- name: Create version file
shell: bash
run: |
echo "${{ env.VERSION }}" > version.txt
echo "Version file created with content: $(cat version.txt)"
- name: Update tools release on GitHub
uses: softprops/action-gh-release@v2
with:
tag_name: tools
files: |
DaCapo/DaCapo.exe
DaCapo/DaCapo.exe.ed25519
version.txt
make_latest: false
- name: Delete Gitee Assets
uses: nicennnnnnnlee/action-gitee-release@master
with:
gitee_action: delete_asset
gitee_owner: aues6uen11z
gitee_repo: da-capo
gitee_token: ${{ secrets.GITEE_TOKEN }}
gitee_tag_name: latest
gitee_delete_assets: |
DaCapo.exe
DaCapo.exe.ed25519
version.txt
- name: Upload assets to Gitee
uses: nicennnnnnnlee/action-gitee-release@master
with:
gitee_action: upload_asset
gitee_owner: aues6uen11z
gitee_repo: da-capo
gitee_token: ${{ secrets.GITEE_TOKEN }}
gitee_tag_name: latest
gitee_upload_retry_times: 3
gitee_files: |
DaCapo/DaCapo.exe
DaCapo/DaCapo.exe.ed25519
version.txt
- 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: |
${{ env.COMPARE_URL && format('**Full Changelog**: {0}', env.COMPARE_URL) || '' }}
files: |
DaCapo-v${{ env.VERSION }}-${{ matrix.build.name }}-portable.zip
DaCapo-v${{ env.VERSION }}-${{ matrix.build.name }}-installer.exe