Skip to content

Commit a8cb3c4

Browse files
committed
feat: .NET 7 support
ci: Initial GA Actions
1 parent ae48aba commit a8cb3c4

8 files changed

Lines changed: 183 additions & 12 deletions

File tree

.github/workflows/main.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
release:
9+
types: [ "published" ]
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
DOTNET_NOLOGO: true
16+
DOTNET_CLI_TELEMETRY_OPTOUT: true
17+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
18+
19+
jobs:
20+
21+
build:
22+
23+
name: ${{ matrix.os }} / ${{ matrix.configuration }}
24+
runs-on: ${{ matrix.os }}
25+
26+
strategy:
27+
fail-fast: true
28+
matrix:
29+
configuration: [ Debug, Release ]
30+
os: [ windows-2022 ]
31+
32+
env:
33+
SRC_SLN_PATH: source/WindowsAPICodePack
34+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
35+
36+
steps:
37+
38+
- uses: actions/checkout@v3
39+
40+
# Assuming .NET Framework flavors are available in OS
41+
- name: Install .NET Core Runtimes
42+
uses: actions/setup-dotnet@v3
43+
with:
44+
dotnet-version: |
45+
6.0.x
46+
5.0.x
47+
3.1.x
48+
49+
# https://github.com/microsoft/setup-msbuild
50+
- name: Add MSBuild.exe to PATH
51+
uses: microsoft/setup-msbuild@v1
52+
53+
# Setup Short SHA
54+
- name: Setup Short SHA
55+
run: echo "build_sha=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV
56+
57+
# Setup Build Suffix (for staging)
58+
- name: Setup Build Suffix
59+
if: github.event_name != 'release'
60+
run: echo "build_suffix=build.${{ env.build_sha }}" >> $env:GITHUB_ENV
61+
62+
# Setup Build Suffix (for release)
63+
- name: Setup Build Suffix
64+
if: github.event_name == 'release'
65+
run: |
66+
$suffix = "${{ github.ref_name }}".Split("-",2)[1]
67+
echo "build_suffix=$( if($suffix) { "${suffix}.${{ env.build_sha }}" } else { '' } )" >> $env:GITHUB_ENV
68+
69+
# Create NuGet Cache
70+
- name: NuGet Cache
71+
id: nuget-cache
72+
uses: actions/cache@v3
73+
with:
74+
path: ${{ env.NUGET_PACKAGES }}
75+
key: ${{ matrix.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
76+
restore-keys: |
77+
${{ matrix.os }}-nuget-
78+
79+
# Restore Build Deps
80+
- name: Restore Dependencies
81+
run: dotnet restore
82+
working-directory: ${{ env.SRC_SLN_PATH }}
83+
84+
# Build Library
85+
- name: Build the Application
86+
run: dotnet build --no-restore -c $env:Configuration -p:VersionSuffix=${{ env.build_suffix }}
87+
working-directory: ${{ env.SRC_SLN_PATH }}
88+
env:
89+
Configuration: ${{ matrix.configuration }}
90+
91+
# Upload Build Artifacts
92+
- name: Upload Build Artifacts
93+
if: matrix.configuration == 'Release'
94+
uses: actions/upload-artifact@v3
95+
with:
96+
name: nupkg-${{ env.build_sha }}
97+
path: ${{env.SRC_SLN_PATH}}/**/bin/${{ matrix.configuration }}/*.*nupkg
98+
99+
stage:
100+
101+
needs: build
102+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
103+
104+
name: Stage Artifacts
105+
runs-on: ubuntu-latest
106+
107+
steps:
108+
109+
- name: Setup Short SHA
110+
run: echo "build_sha=${GITHUB_SHA::7}" >> $GITHUB_ENV
111+
112+
- name: Download Build Artifacts
113+
uses: actions/download-artifact@v3
114+
with:
115+
name: nupkg-${{ env.build_sha }}
116+
117+
- uses: actions/setup-dotnet@v3
118+
with:
119+
dotnet-version: '6.0.x'
120+
121+
- name: Push to NuGet
122+
run: |
123+
for pkg in $GITHUB_WORKSPACE/**/bin/Release/*.nupkg
124+
do
125+
cd $(dirname $pkg)
126+
echo "Publishing $(basename $pkg)"
127+
dotnet nuget push "$(basename $pkg)" -k ${{ secrets.NUGET_TEST_API_KEY }} -s ${{ vars.NUGET_TEST_API_KEY_SOURCE }} --skip-duplicate
128+
done
129+
130+
deploy:
131+
132+
needs: build
133+
if: github.event_name == 'release'
134+
135+
name: Release Artifacts
136+
runs-on: ubuntu-latest
137+
138+
steps:
139+
140+
- name: Setup Short SHA
141+
run: echo "build_sha=${GITHUB_SHA::7}" >> $GITHUB_ENV
142+
143+
- name: Download Build Artifacts
144+
uses: actions/download-artifact@v3
145+
with:
146+
name: nupkg-${{ env.build_sha }}
147+
148+
- uses: actions/setup-dotnet@v3
149+
with:
150+
dotnet-version: '6.0.x'
151+
152+
- name: Push to NuGet
153+
run: |
154+
for pkg in $GITHUB_WORKSPACE/**/bin/Release/*.nupkg
155+
do
156+
cd $(dirname $pkg)
157+
echo "Publishing $(basename $pkg)"
158+
dotnet nuget push "$(basename $pkg)" -k ${{ secrets.NUGET_API_KEY }} -s ${{ vars.NUGET_API_KEY_SOURCE }} --skip-duplicate
159+
done

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
### v1.1.6 Preview
2+
3+
**Core 1.1.6**
4+
**Shell 1.1.6**
5+
**ShellExtensions 1.1.6**
6+
**Sensors 1.1.6**
7+
**ExtendedLinguisticServices 1.1.6**
8+
9+
- Initial GA Actions Support
10+
- Added New Target .NET 7.0
11+
112
### 2022-11-04
213

314
**Core 1.1.5**

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# Windows-API-Code-Pack-1.1.5
1+
# Windows API Code Pack
22

3+
[![CI Build](https://github.com/samypr100/Windows-API-Code-Pack-1.1/actions/workflows/main.yml/badge.svg)](https://github.com/samypr100/Windows-API-Code-Pack-1.1/actions/workflows/main.yml)
34
[![Nuget Version](https://img.shields.io/nuget/v/Microsoft-WindowsAPICodePack-Core-6.0.svg)](https://www.nuget.org/packages?q=Microsoft-WindowsAPICodePack+6.0)
45

56
## README
67

78
This is a fork of the Microsoft © Windows API Code Pack, based on a repository created by [contre](https://github.com/contre/Windows-API-Code-Pack-1.1). Due to the lack of updates to the original package, this fork was created to add support for all current .NET Framework and .NET Core versions.
89

9-
Now with added .Net6.0 support ! (windows only)
10+
Now with added .NET 6.0, .NET 7.0 support ! (windows only)
1011

1112
## NuGet packages (recommended)
1213

source/WindowsAPICodePack/Core/Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>Microsoft.WindowsAPICodePack</AssemblyName>
55
<PackageId>Microsoft-WindowsAPICodePack-Core-6.0</PackageId>
6-
<VersionPrefix>1.1.5</VersionPrefix>
6+
<VersionPrefix>1.1.6</VersionPrefix>
77
<Title>$(AssemblyName)</Title>
88
<Authors>rpastric;contre;dahall;samypr100</Authors>
99
<Company>Microsoft</Company>
@@ -21,7 +21,7 @@
2121
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2222
<IncludeSymbols>true</IncludeSymbols>
2323
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
24-
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
24+
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
2525
<UseWindowsForms>true</UseWindowsForms>
2626
<LangVersion>latest</LangVersion>
2727
<RootNamespace>Microsoft.WindowsAPICodePack</RootNamespace>

source/WindowsAPICodePack/ExtendedLinguisticServices/ExtendedLinguisticServices.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>Microsoft.WindowsAPICodePack.ExtendedLinguisticServices</AssemblyName>
55
<PackageId>Microsoft-WindowsAPICodePack-ExtendedLinguisticServices-6.0</PackageId>
6-
<VersionPrefix>1.1.5</VersionPrefix>
6+
<VersionPrefix>1.1.6</VersionPrefix>
77
<Title>$(AssemblyName)</Title>
88
<Authors>rpastric;contre;dahall;samypr100</Authors>
99
<Company>Microsoft</Company>
@@ -21,7 +21,7 @@
2121
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2222
<IncludeSymbols>true</IncludeSymbols>
2323
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
24-
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
24+
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
2525
<UseWindowsForms>true</UseWindowsForms>
2626
<LangVersion>latest</LangVersion>
2727
<RootNamespace>Microsoft.WindowsAPICodePack.ExtendedLinguisticServices</RootNamespace>

source/WindowsAPICodePack/Sensors/Sensors.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>Microsoft.WindowsAPICodePack.Sensors</AssemblyName>
55
<PackageId>Microsoft-WindowsAPICodePack-Sensors-6.0</PackageId>
6-
<VersionPrefix>1.1.5</VersionPrefix>
6+
<VersionPrefix>1.1.6</VersionPrefix>
77
<Title>$(AssemblyName)</Title>
88
<Authors>rpastric;contre;dahall;samypr100</Authors>
99
<Company>Microsoft</Company>
@@ -21,7 +21,7 @@
2121
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2222
<IncludeSymbols>true</IncludeSymbols>
2323
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
24-
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
24+
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
2525
<UseWindowsForms>true</UseWindowsForms>
2626
<LangVersion>latest</LangVersion>
2727
<RootNamespace>Microsoft.WindowsAPICodePack.Sensors</RootNamespace>

source/WindowsAPICodePack/Shell/Shell.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>Microsoft.WindowsAPICodePack.Shell</AssemblyName>
55
<PackageId>Microsoft-WindowsAPICodePack-Shell-6.0</PackageId>
6-
<VersionPrefix>1.1.5</VersionPrefix>
6+
<VersionPrefix>1.1.6</VersionPrefix>
77
<Title>$(AssemblyName)</Title>
88
<Authors>rpastric;contre;dahall;samypr100</Authors>
99
<Company>Microsoft</Company>
@@ -21,7 +21,7 @@
2121
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2222
<IncludeSymbols>true</IncludeSymbols>
2323
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
24-
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
24+
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
2525
<UseWindowsForms>true</UseWindowsForms>
2626
<UseWPF>true</UseWPF>
2727
<LangVersion>latest</LangVersion>

source/WindowsAPICodePack/ShellExtensions/ShellExtensions.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>Microsoft.WindowsAPICodePack.ShellExtensions</AssemblyName>
55
<PackageId>Microsoft-WindowsAPICodePack-ShellExtensions-6.0</PackageId>
6-
<VersionPrefix>1.1.5</VersionPrefix>
6+
<VersionPrefix>1.1.6</VersionPrefix>
77
<Title>$(AssemblyName)</Title>
88
<Authors>rpastric;contre;dahall;samypr100</Authors>
99
<Company>Microsoft</Company>
@@ -21,7 +21,7 @@
2121
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2222
<IncludeSymbols>true</IncludeSymbols>
2323
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
24-
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
24+
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
2525
<UseWindowsForms>true</UseWindowsForms>
2626
<UseWPF>true</UseWPF>
2727
<LangVersion>latest</LangVersion>

0 commit comments

Comments
 (0)