Skip to content

Commit

Permalink
feat: .NET 7 support
Browse files Browse the repository at this point in the history
ci: Initial GA Actions
  • Loading branch information
samypr100 committed Mar 19, 2023
1 parent ae48aba commit a8cb3c4
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 12 deletions.
159 changes: 159 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [ "published" ]

permissions:
contents: read

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:

build:

name: ${{ matrix.os }} / ${{ matrix.configuration }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
configuration: [ Debug, Release ]
os: [ windows-2022 ]

env:
SRC_SLN_PATH: source/WindowsAPICodePack
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages

steps:

- uses: actions/checkout@v3

# Assuming .NET Framework flavors are available in OS
- name: Install .NET Core Runtimes
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
5.0.x
3.1.x
# https://github.com/microsoft/setup-msbuild
- name: Add MSBuild.exe to PATH
uses: microsoft/setup-msbuild@v1

# Setup Short SHA
- name: Setup Short SHA
run: echo "build_sha=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV

# Setup Build Suffix (for staging)
- name: Setup Build Suffix
if: github.event_name != 'release'
run: echo "build_suffix=build.${{ env.build_sha }}" >> $env:GITHUB_ENV

# Setup Build Suffix (for release)
- name: Setup Build Suffix
if: github.event_name == 'release'
run: |
$suffix = "${{ github.ref_name }}".Split("-",2)[1]
echo "build_suffix=$( if($suffix) { "${suffix}.${{ env.build_sha }}" } else { '' } )" >> $env:GITHUB_ENV
# Create NuGet Cache
- name: NuGet Cache
id: nuget-cache
uses: actions/cache@v3
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ matrix.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ matrix.os }}-nuget-
# Restore Build Deps
- name: Restore Dependencies
run: dotnet restore
working-directory: ${{ env.SRC_SLN_PATH }}

# Build Library
- name: Build the Application
run: dotnet build --no-restore -c $env:Configuration -p:VersionSuffix=${{ env.build_suffix }}
working-directory: ${{ env.SRC_SLN_PATH }}
env:
Configuration: ${{ matrix.configuration }}

# Upload Build Artifacts
- name: Upload Build Artifacts
if: matrix.configuration == 'Release'
uses: actions/upload-artifact@v3
with:
name: nupkg-${{ env.build_sha }}
path: ${{env.SRC_SLN_PATH}}/**/bin/${{ matrix.configuration }}/*.*nupkg

stage:

needs: build
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'

name: Stage Artifacts
runs-on: ubuntu-latest

steps:

- name: Setup Short SHA
run: echo "build_sha=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Download Build Artifacts
uses: actions/download-artifact@v3
with:
name: nupkg-${{ env.build_sha }}

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'

- name: Push to NuGet
run: |
for pkg in $GITHUB_WORKSPACE/**/bin/Release/*.nupkg
do
cd $(dirname $pkg)
echo "Publishing $(basename $pkg)"
dotnet nuget push "$(basename $pkg)" -k ${{ secrets.NUGET_TEST_API_KEY }} -s ${{ vars.NUGET_TEST_API_KEY_SOURCE }} --skip-duplicate
done
deploy:

needs: build
if: github.event_name == 'release'

name: Release Artifacts
runs-on: ubuntu-latest

steps:

- name: Setup Short SHA
run: echo "build_sha=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Download Build Artifacts
uses: actions/download-artifact@v3
with:
name: nupkg-${{ env.build_sha }}

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'

- name: Push to NuGet
run: |
for pkg in $GITHUB_WORKSPACE/**/bin/Release/*.nupkg
do
cd $(dirname $pkg)
echo "Publishing $(basename $pkg)"
dotnet nuget push "$(basename $pkg)" -k ${{ secrets.NUGET_API_KEY }} -s ${{ vars.NUGET_API_KEY_SOURCE }} --skip-duplicate
done
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### v1.1.6 Preview

**Core 1.1.6**
**Shell 1.1.6**
**ShellExtensions 1.1.6**
**Sensors 1.1.6**
**ExtendedLinguisticServices 1.1.6**

- Initial GA Actions Support
- Added New Target .NET 7.0

### 2022-11-04

**Core 1.1.5**
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Windows-API-Code-Pack-1.1.5
# Windows API Code Pack

[![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)
[![Nuget Version](https://img.shields.io/nuget/v/Microsoft-WindowsAPICodePack-Core-6.0.svg)](https://www.nuget.org/packages?q=Microsoft-WindowsAPICodePack+6.0)

## README

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.

Now with added .Net6.0 support ! (windows only)
Now with added .NET 6.0, .NET 7.0 support ! (windows only)

## NuGet packages (recommended)

Expand Down
4 changes: 2 additions & 2 deletions source/WindowsAPICodePack/Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.WindowsAPICodePack</AssemblyName>
<PackageId>Microsoft-WindowsAPICodePack-Core-6.0</PackageId>
<VersionPrefix>1.1.5</VersionPrefix>
<VersionPrefix>1.1.6</VersionPrefix>
<Title>$(AssemblyName)</Title>
<Authors>rpastric;contre;dahall;samypr100</Authors>
<Company>Microsoft</Company>
Expand All @@ -21,7 +21,7 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>latest</LangVersion>
<RootNamespace>Microsoft.WindowsAPICodePack</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.WindowsAPICodePack.ExtendedLinguisticServices</AssemblyName>
<PackageId>Microsoft-WindowsAPICodePack-ExtendedLinguisticServices-6.0</PackageId>
<VersionPrefix>1.1.5</VersionPrefix>
<VersionPrefix>1.1.6</VersionPrefix>
<Title>$(AssemblyName)</Title>
<Authors>rpastric;contre;dahall;samypr100</Authors>
<Company>Microsoft</Company>
Expand All @@ -21,7 +21,7 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>latest</LangVersion>
<RootNamespace>Microsoft.WindowsAPICodePack.ExtendedLinguisticServices</RootNamespace>
Expand Down
4 changes: 2 additions & 2 deletions source/WindowsAPICodePack/Sensors/Sensors.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.WindowsAPICodePack.Sensors</AssemblyName>
<PackageId>Microsoft-WindowsAPICodePack-Sensors-6.0</PackageId>
<VersionPrefix>1.1.5</VersionPrefix>
<VersionPrefix>1.1.6</VersionPrefix>
<Title>$(AssemblyName)</Title>
<Authors>rpastric;contre;dahall;samypr100</Authors>
<Company>Microsoft</Company>
Expand All @@ -21,7 +21,7 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>latest</LangVersion>
<RootNamespace>Microsoft.WindowsAPICodePack.Sensors</RootNamespace>
Expand Down
4 changes: 2 additions & 2 deletions source/WindowsAPICodePack/Shell/Shell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.WindowsAPICodePack.Shell</AssemblyName>
<PackageId>Microsoft-WindowsAPICodePack-Shell-6.0</PackageId>
<VersionPrefix>1.1.5</VersionPrefix>
<VersionPrefix>1.1.6</VersionPrefix>
<Title>$(AssemblyName)</Title>
<Authors>rpastric;contre;dahall;samypr100</Authors>
<Company>Microsoft</Company>
Expand All @@ -21,7 +21,7 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.WindowsAPICodePack.ShellExtensions</AssemblyName>
<PackageId>Microsoft-WindowsAPICodePack-ShellExtensions-6.0</PackageId>
<VersionPrefix>1.1.5</VersionPrefix>
<VersionPrefix>1.1.6</VersionPrefix>
<Title>$(AssemblyName)</Title>
<Authors>rpastric;contre;dahall;samypr100</Authors>
<Company>Microsoft</Company>
Expand All @@ -21,7 +21,7 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net452;net462;net472;net48;net481;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<LangVersion>latest</LangVersion>
Expand Down

0 comments on commit a8cb3c4

Please sign in to comment.