Skip to content

Commit 4807358

Browse files
committed
cherry-pick from #2616 to support GitHub action
1 parent 6f661ef commit 4807358

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

.github/workflows/dotnet.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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: .NET
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- dev
11+
- master
12+
pull_request:
13+
branches:
14+
- dev
15+
- master
16+
17+
jobs:
18+
build:
19+
20+
runs-on: windows-latest
21+
env:
22+
FlowVersion: 1.18.0
23+
NUGET_CERT_REVOCATION_MODE: offline
24+
BUILD_NUMBER: ${{ github.run_number }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Set Flow.Launcher.csproj version
28+
id: update
29+
uses: vers-one/[email protected]
30+
with:
31+
file: |
32+
"**/SolutionAssemblyInfo.cs"
33+
version: ${{ env.FlowVersion }}.${{ env.BUILD_NUMBER }}
34+
- uses: actions/cache@v4
35+
name: Restore Nuget Cache
36+
with:
37+
path: |
38+
~/.nuget/packages
39+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
40+
restore-keys: |
41+
${{ runner.os }}-nuget
42+
- uses: actions/cache@v4
43+
name: Restore dotnet tool Cache
44+
with:
45+
path: |
46+
~/.dotnet/tools
47+
key: ${{ runner.os }}-dotnet-tools-${{ hashFiles('~/.dotnet/tools/**') }}
48+
restore-keys: |
49+
${{ runner.os }}-dotnet-tools
50+
- name: Setup .NET
51+
uses: actions/setup-dotnet@v4
52+
with:
53+
dotnet-version: 7.0.x
54+
- name: Install vpk
55+
Install vpk tool (dotnet tool install will not reinstall if already installed)
56+
We will update the cli by removing cache
57+
run: |
58+
if (!(Get-Command vpk -ErrorAction SilentlyContinue)) {
59+
dotnet tool install -g vpk
60+
}
61+
- name: Restore dependencies
62+
run: dotnet restore
63+
- name: Build
64+
run: dotnet build --no-restore -c Release
65+
- name: Initialize Service
66+
run: |
67+
sc config WSearch start= auto # Starts Windows Search service- Needed for running ExplorerTest
68+
net start WSearch
69+
- name: Test
70+
run: dotnet test --no-build --verbosity normal -c Release
71+
- name: Perform post_build tasks
72+
shell: pwsh
73+
run: .\Scripts\post_build.ps1 -flowversion "${env:FlowVersion}-build.${env:BUILD_NUMBER}"
74+
- name: Upload Plugin Nupkg
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: Plugin nupkg
78+
path: |
79+
Output\Release\Flow.Launcher.Plugin.*.nupkg
80+
compression-level: 0
81+
- name: Upload Setup
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: Flow Installer
85+
path: |
86+
Releases\FlowLauncher-*.exe
87+
compression-level: 0
88+
- name: Upload Portable Version
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: Portable Version
92+
path: |
93+
Releases\FlowLauncher-*-Portable.zip
94+
compression-level: 0
95+
# - name: Upload Full Nupkg
96+
# uses: actions/upload-artifact@v4
97+
# with:
98+
# name: Full nupkg
99+
# path: |
100+
# Releases\FlowLauncher-*-full.nupkg
101+
#
102+
# compression-level: 0
103+
# - name: Upload Release Information
104+
# uses: actions/upload-artifact@v4
105+
# with:
106+
# name: RELEASES
107+
# path: |
108+
# Releases\RELEASES*
109+
# compression-level: 0
110+
#

0 commit comments

Comments
 (0)