Skip to content

Add github workflow

Add github workflow #1

Workflow file for this run

name: Build
on:
push:
branches:
- master
tags:
- 'v*'
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache .NET packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Run NUKE
run: ./build.ps1 PublishWindows PublishWindowsFrameworkDependent
- name: Upload Windows Artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-windows
path: artifacts/windows*/**/*
retention-days: 7
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache .NET packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Install create-dmg
run: brew install create-dmg
- name: Run NUKE
run: ./build.sh PublishMacOS PublishMacOSFrameworkDependent CreateMacOSDmg
- name: Upload macOS Artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-macos
path: artifacts/macos*/**/*
retention-days: 7
release:
needs: [build-windows, build-macos]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}