Skip to content

Commit 252753f

Browse files
authored
Merge pull request #2986 from Flow-Launcher/github-action
GitHub action
2 parents d30fdbb + 577ae34 commit 252753f

File tree

2 files changed

+98
-7
lines changed

2 files changed

+98
-7
lines changed

.github/workflows/dotnet.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Build
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- dev
11+
- master
12+
pull_request:
13+
14+
jobs:
15+
build:
16+
17+
runs-on: windows-latest
18+
env:
19+
FlowVersion: 1.19.5
20+
NUGET_CERT_REVOCATION_MODE: offline
21+
BUILD_NUMBER: ${{ github.run_number }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set Flow.Launcher.csproj version
25+
id: update
26+
uses: vers-one/[email protected]
27+
with:
28+
file: |
29+
"**/SolutionAssemblyInfo.cs"
30+
version: ${{ env.FlowVersion }}.${{ env.BUILD_NUMBER }}
31+
- name: Setup .NET
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: 7.0.x
35+
# cache: true
36+
# cache-dependency-path: |
37+
# Flow.Launcher/packages.lock.json
38+
# Flow.Launcher.Core/packages.lock.json
39+
# Flow.Launcher.Infrastructure/packages.lock.json
40+
# Flow.Launcher.Plugin/packages.lock.json
41+
- name: Install vpk
42+
run: dotnet tool install -g vpk
43+
- name: Restore dependencies
44+
run: nuget restore
45+
- name: Build
46+
run: dotnet build --no-restore -c Release
47+
- name: Initialize Service
48+
run: |
49+
sc config WSearch start= auto # Starts Windows Search service- Needed for running ExplorerTest
50+
net start WSearch
51+
- name: Test
52+
run: dotnet test --no-build --verbosity normal -c Release
53+
- name: Perform post_build tasks
54+
shell: powershell
55+
run: .\Scripts\post_build.ps1
56+
- name: Upload Plugin Nupkg
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: Plugin nupkg
60+
path: |
61+
Output\Release\Flow.Launcher.Plugin.*.nupkg
62+
compression-level: 0
63+
- name: Upload Setup
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: Flow Installer
67+
path: |
68+
Output\Packages\Flow-Launcher-*.exe
69+
compression-level: 0
70+
- name: Upload Portable Version
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: Portable Version
74+
path: |
75+
Output\Packages\Flow-Launcher-Portable.zip
76+
compression-level: 0
77+
- name: Upload Full Nupkg
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: Full nupkg
81+
path: |
82+
Output\Packages\FlowLauncher-*-full.nupkg
83+
84+
compression-level: 0
85+
- name: Upload Release Information
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: RELEASES
89+
path: |
90+
Output\Packages\RELEASES
91+
compression-level: 0

Scripts/post_build.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
param(
2-
[string]$config = "Release",
2+
[string]$config = "Release",
33
[string]$solution = (Join-Path $PSScriptRoot ".." -Resolve)
44
)
55
Write-Host "Config: $config"
@@ -40,11 +40,11 @@ function Delete-Unused ($path, $config) {
4040
$target = "$path\Output\$config"
4141
$included = Get-ChildItem $target -Filter "*.dll"
4242
foreach ($i in $included){
43-
$deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq "$i" }
43+
$deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq "$i" }
4444
$deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName }
4545
$deleteList | Remove-Item
4646
}
47-
Remove-Item -Path $target -Include "*.xml" -Recurse
47+
Remove-Item -Path $target -Include "*.xml" -Recurse
4848
}
4949

5050
function Remove-CreateDumpExe ($path, $config) {
@@ -87,7 +87,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
8787
Squirrel --releasify $nupkg --releaseDir $temp --setupIcon $icon --no-msi | Write-Output
8888
Move-Item $temp\* $output -Force
8989
Remove-Item $temp
90-
90+
9191
$file = "$output\Flow-Launcher-Setup.exe"
9292
Write-Host "Filename: $file"
9393

@@ -107,7 +107,7 @@ function Publish-Self-Contained ($p) {
107107
}
108108

109109
function Publish-Portable ($outputLocation, $version) {
110-
110+
111111
& $outputLocation\Flow-Launcher-Setup.exe --silent | Out-Null
112112
mkdir "$env:LocalAppData\FlowLauncher\app-$version\UserData"
113113
Compress-Archive -Path $env:LocalAppData\FlowLauncher -DestinationPath $outputLocation\Flow-Launcher-Portable.zip
@@ -119,7 +119,7 @@ function Main {
119119
Copy-Resources $p
120120

121121
if ($config -eq "Release"){
122-
122+
123123
Delete-Unused $p $config
124124

125125
Publish-Self-Contained $p
@@ -134,4 +134,4 @@ function Main {
134134
}
135135
}
136136

137-
Main
137+
Main

0 commit comments

Comments
 (0)