Skip to content

Change requested execution level to 'asInvoker' for compatibility wit… #8

Change requested execution level to 'asInvoker' for compatibility wit…

Change requested execution level to 'asInvoker' for compatibility wit… #8

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
tags: [ 'Beta.*', 'v*' ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
- name: Publish (framework-dependent)
run: dotnet publish ScreenGrid.csproj -c Release -r win-x64 --no-self-contained -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=false -o ./artifacts/framework-dependent
- name: Publish (self-contained)
run: dotnet publish ScreenGrid.csproj -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -o ./artifacts/self-contained
- name: Install Inno Setup
run: choco install innosetup -y --no-progress
- name: Build Installer
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer/ScreenGridSetup.iss
shell: pwsh
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: ScreenGrid-installer
path: installer-output/ScreenGridSetup.exe
- name: Upload framework-dependent artifact
uses: actions/upload-artifact@v4
with:
name: ScreenGrid-framework-dependent
path: artifacts/framework-dependent/ScreenGrid.exe
- name: Upload self-contained artifact
uses: actions/upload-artifact@v4
with:
name: ScreenGrid-self-contained
path: artifacts/self-contained/ScreenGrid.exe
# Rolling pre-release on every push to main
latest-release:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: build-and-test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: ScreenGrid-framework-dependent
path: ./framework-dependent
- uses: actions/download-artifact@v4
with:
name: ScreenGrid-self-contained
path: ./self-contained
- uses: actions/download-artifact@v4
with:
name: ScreenGrid-installer
path: ./installer
- name: Rename artifacts
run: |
mv ./framework-dependent/ScreenGrid.exe ./ScreenGrid-small.exe
mv ./self-contained/ScreenGrid.exe ./ScreenGrid-standalone.exe
mv ./installer/ScreenGridSetup.exe ./ScreenGridSetup.exe
- name: Create/Update rolling release
uses: softprops/action-gh-release@v2
with:
tag_name: latest
name: Latest Build
body: |
**Automated build from `main`**
| File | Size | Requires .NET? |
|------|------|----------------|
| `ScreenGrid-small.exe` | ~200 KB | Yes (.NET 9) |
| `ScreenGrid-standalone.exe` | ~70 MB | No |
| `ScreenGridSetup.exe` | ~66 MB | No (installer) |
files: |
ScreenGrid-small.exe
ScreenGrid-standalone.exe
ScreenGridSetup.exe
prerelease: true
make_latest: true
# Versioned release on tag push (e.g. Beta.1.0, v1.0.0)
versioned-release:
if: startsWith(github.ref, 'refs/tags/')
needs: build-and-test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: ScreenGrid-framework-dependent
path: ./framework-dependent
- uses: actions/download-artifact@v4
with:
name: ScreenGrid-self-contained
path: ./self-contained
- uses: actions/download-artifact@v4
with:
name: ScreenGrid-installer
path: ./installer
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Rename artifacts
run: |
mv ./framework-dependent/ScreenGrid.exe ./ScreenGrid-small.exe
mv ./self-contained/ScreenGrid.exe ./ScreenGrid-standalone.exe
mv ./installer/ScreenGridSetup.exe ./ScreenGridSetup.exe
- name: Create versioned release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ScreenGrid ${{ steps.version.outputs.VERSION }}
body: |
## ScreenGrid ${{ steps.version.outputs.VERSION }}
### Downloads
| File | Size | Requires .NET? |
|------|------|----------------|
| `ScreenGridSetup.exe` | ~66 MB | No (installer, auto-startup) |
| `ScreenGrid-small.exe` | ~200 KB | Yes (.NET 9 Desktop Runtime) |
| `ScreenGrid-standalone.exe` | ~70 MB | No |
### What's New
See the [commit history](https://github.com/${{ github.repository }}/commits/${{ github.ref_name }}) for changes.
files: |
ScreenGrid-small.exe
ScreenGrid-standalone.exe
ScreenGridSetup.exe
prerelease: ${{ startsWith(github.ref_name, 'Beta') }}
make_latest: ${{ !startsWith(github.ref_name, 'Beta') }}