mirror of
https://github.com/R0m1k3/EveFlow.git
synced 2026-10-11 17:29:03 +02:00
80 lines
2.5 KiB
YAML
80 lines
2.5 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
check:
|
|
name: Typecheck & tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run typecheck
|
|
- run: npm test
|
|
- run: npm run build:renderer
|
|
|
|
build-windows:
|
|
name: Build Windows installer
|
|
needs: check
|
|
if: github.event_name != 'pull_request'
|
|
runs-on: windows-latest
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
- run: npm ci
|
|
- name: Read version
|
|
id: ver
|
|
shell: bash
|
|
run: |
|
|
version=$(node -p "const p=require('./package.json'); p.releaseVersion || p.version")
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
# Fourth component (hotfix number, e.g. 2.0.0.1) becomes the Windows file build number.
|
|
echo "build=$(echo "$version" | cut -d. -f4)" >> "$GITHUB_OUTPUT"
|
|
if git ls-remote --exit-code --tags origin "refs/tags/v$version" >/dev/null 2>&1; then
|
|
echo "released=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "released=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
- run: npm run build
|
|
- name: Package Windows EXE
|
|
run: npm run dist -- --win --publish never
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
BUILD_NUMBER: ${{ steps.ver.outputs.build }}
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: EveFlow-Windows-v${{ steps.ver.outputs.version }}
|
|
path: |
|
|
out/*.exe
|
|
out/*.exe.blockmap
|
|
out/latest.yml
|
|
if-no-files-found: error
|
|
- name: Publish GitHub release
|
|
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && steps.ver.outputs.released == 'false')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: v${{ steps.ver.outputs.version }}
|
|
name: EveFlow ${{ steps.ver.outputs.version }}
|
|
generate_release_notes: true
|
|
files: |
|
|
out/*.exe
|
|
out/*.exe.blockmap
|
|
out/latest.yml
|