63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
name: Overlord Desktop Windows Release
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths:
|
|
- "Overlord-Desktop/**"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: Overlord-Desktop
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install Dependencies
|
|
run: npm install
|
|
|
|
- name: Get Version
|
|
run: |
|
|
$version = (Get-Content package.json | ConvertFrom-Json).version
|
|
echo "VERSION=$version" >> $env:GITHUB_ENV
|
|
shell: pwsh
|
|
|
|
- name: Build Windows Installer
|
|
run: npm run build:win
|
|
|
|
- name: Upload Build Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: overlord-desktop-${{ env.VERSION }}
|
|
path: Overlord-Desktop/dist/Overlord Setup.exe
|
|
|
|
- name: Delete Existing Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release delete Overlord-Desktop-v${{ env.VERSION }} --yes --cleanup-tag || echo "No existing release/tag to delete"
|
|
shell: bash
|
|
|
|
- name: Create Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release create Overlord-Desktop-v${{ env.VERSION }} "dist/Overlord Setup.exe" \
|
|
-t "Overlord Desktop v${{ env.VERSION }}" \
|
|
-n "Automated build release for Overlord Desktop v${{ env.VERSION }}" \
|
|
--draft=false \
|
|
--prerelease=false
|
|
shell: bash
|