Windows Release #154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows Release | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: Release | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- amd64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ secrets.GH_REPO }} | |
token: ${{ secrets.GH_PAT }} | |
fetch-depth: 0 | |
- name: Checkout latest version | |
shell: bash | |
run: | | |
version=$(git describe --tags --abbrev=0) | |
git checkout "$version" | |
echo "KIKOERU_VERSION=$version" >> $GITHUB_ENV | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'web/package.json' | |
check-latest: true | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Build frontend | |
shell: bash | |
run: | | |
pnpm install | |
pnpm build | |
cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/ | |
working-directory: ./web | |
- name: Build | |
shell: bash | |
run: | | |
go mod download | |
export GOARCH=${{ matrix.arch }} | |
bash build.sh | |
- name: Package | |
shell: bash | |
run: | | |
dist="kikoeru-windows-${{ matrix.arch }}" | |
mkdir -p "$dist" | |
cp kikoeru.exe scripts/start.bat "$dist/" | |
7z a "$dist.zip" "$dist/" | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ env.KIKOERU_VERSION }} | |
tag_name: ${{ env.KIKOERU_VERSION }} | |
draft: true | |
body: | | |
- 本更新包括稳定性提升和错误修复。 | |
files: | | |
kikoeru-*.* |