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 and Tag env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Delete the release (--cleanup-tag attempts to delete the tag too) gh release delete Overlord-Desktop-v${{ env.VERSION }} --yes --cleanup-tag || true # Explicitly delete the git tag ref via API in case the above didn't clean it up gh api --method DELETE /repos/${{ github.repository }}/git/refs/tags/Overlord-Desktop-v${{ env.VERSION }} || true shell: bash - name: Create Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create Overlord-Desktop-v${{ env.VERSION }} "dist/Overlord Setup.exe" "PLEASE_READ.txt" \ -t "Overlord Desktop v${{ env.VERSION }}" \ -n "Automated build release for Overlord Desktop v${{ env.VERSION }}" \ --draft=false \ --prerelease=false shell: bash