Skip to content

Build and package for release #6

Build and package for release

Build and package for release #6

Workflow file for this run

name: Build and package for release
on:
release:
types: [published]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
environment:
description: 'Environment to deploy'
required: false
default: 'staging'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src\CanIUse\Community.PowerToys.Run.Plugin.CanIUse\Community.PowerToys.Run.Plugin.CanIUse.csproj
- name: Create temporary solution for building
run: dotnet new sln -n "BuildTemporary"
- name: Add project to temporary solution
run: dotnet sln "BuildTemporary.sln" add src\CanIUse\Community.PowerToys.Run.Plugin.CanIUse\Community.PowerToys.Run.Plugin.CanIUse.csproj
- name: Build project
run: dotnet build "BuildTemporary.sln" --configuration Release --output ./build_output/CanIUse
- name: Create ZIP of build output
shell: pwsh # Use PowerShell shell
run: |
# Exclude specific files and create the zip file
$exclude = @("PowerToys.Common.UI.dll", "PowerToys.ManagedCommon.dll", "PowerToys.Settings.UI.Lib.dll", "Wox.Infrastructure.dll", "Wox.Plugin.dll")
Get-ChildItem -Recurse ./build_output | Where-Object {
$exclude -notcontains $_.Extension
} | Compress-Archive -DestinationPath CanIUse.zip -Update
- name: Upload project artifacts
uses: actions/upload-artifact@v3
with:
name: Project
path: CanIUse.zip