Skip to content

Commit

Permalink
Add github actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarypiatek committed Jan 2, 2021
1 parent e449dce commit 9f93744
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 27 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/pr-verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: pr-verification
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build-extension:
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Configuration: Release
SolutionPath: MappingGenerator\MappingGenerator.sln
VsixManifestPath: MappingGenerator\MappingGenerator\MappingGenerator.Vsix\source.extension.vsixmanifest
Version: '1.21.${{ github.run_number }}-pr'
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
with:
vs-version: '[16.8,16.9)'
- name: Setup nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: Restore NuGet Packages
run: nuget restore $env:SolutionPath
- name: Set version for VSIX
run: |
$manifestXml = [xml](Get-Content $env:VsixManifestPath -Raw)
$manifestXml.PackageManifest.Metadata.Identity.Version = $env:Version
$manifestXml.save($env:VsixManifestPath)
- name: Build extension
run: msbuild $env:SolutionPath /t:Rebuild
env:
DeployExtension: False
- name: Test extension
run: dotnet test --no-build --verbosity normal $env:SolutionPath
- name: Collect artifacts - VSIX
uses: actions/upload-artifact@v2
with:
name: MappingGenerator-VSIX
path: MappingGenerator\MappingGenerator\MappingGenerator.Vsix\bin\Release\MappingGenerator.vsix
- name: Collect artifacts - nugets
uses: actions/upload-artifact@v2
with:
name: MappingGenerator-Nugets
path: '**/MappingGenerator*.nupkg'
99 changes: 99 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: release
on:
push:
branches:
- master
jobs:
build-extension:
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Configuration: Release
SolutionPath: MappingGenerator\MappingGenerator.sln
VsixManifestPath: MappingGenerator\MappingGenerator\MappingGenerator.Vsix\source.extension.vsixmanifest
VsixPath: MappingGenerator\MappingGenerator\MappingGenerator.Vsix\bin\Release\MappingGenerator.vsix
VsixPublishManifestPath: MappingGenerator\MappingGenerator\MappingGenerator.Vsix\publishManifest.json
Version: '1.21.${{ github.run_number }}'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Fetch all history and tags from all branches for release note
run: git fetch --prune --unshallow
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
id: MsBuildSetup
with:
vs-version: '[16.8,16.9)'
- name: Setup nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: Restore NuGet Packages
run: nuget restore $env:SolutionPath
- name: Set version for VSIX
run: |
$manifestXml = [xml](Get-Content $env:VsixManifestPath -Raw)
$manifestXml.PackageManifest.Metadata.Identity.Version = $env:Version
$manifestXml.save($env:VsixManifestPath)
- name: Build extension
run: msbuild $env:SolutionPath /t:Rebuild
env:
DeployExtension: False
- name: Test extension
run: dotnet test --no-build --verbosity normal $env:SolutionPath
- name: Generate release note
run: |
$commitLog = git log "$(git describe --tags --abbrev=0)..HEAD" --pretty=format:"- %s"
"What's new: `r`n`r`n$([string]::Join("`r`n",$commitLog))" | Out-File release_note.md -Encoding utf8
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.Version }}
release_name: ${{ env.Version }}
body_path: release_note.md
draft: false
prerelease: false
- name: Upload Release Asset - MappingGenerator.vsix
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.VsixPath }}
asset_name: MappingGenerator.vsix
asset_content_type: binary/octet-stream
- name: Upload Release Asset - MappingGenerator Nuget
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: MappingGenerator\MappingGenerator\MappingGenerator\bin\Release\MappingGenerator.${{ env.Version }}.nupkg
asset_name: MappingGenerator.${{ env.Version }}.nupkg
asset_content_type: binary/octet-stream
- name: Upload Release Asset - MappingGenerator.OnBuildGenerator Nuget
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: MappingGenerator\OnBuildGenerator\bin\Release\MappingGenerator.OnBuildGenerator.${{ env.Version }}.nupkg
asset_name: MappingGenerator.OnBuildGenerator.${{ env.Version }}.nupkg
asset_content_type: binary/octet-stream
- name: Publish extension to Marketplace
run: |
$MsBuildDir = "${{ steps.MsBuildSetup.outputs.msbuildPath }}"
$VsixPublisher = Join-Path -Path $MsBuildDir -ChildPath "..\..\..\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" -Resolve
& $VsixPublisher publish -personalAccessToken ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }} -payload $env:VsixPath -publishManifest $env:VsixPublishManifestPath
- name: Publish extension to Nuget
run: |
dotnet nuget push MappingGenerator\MappingGenerator\MappingGenerator\bin\Release\MappingGenerator.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
dotnet nuget push MappingGenerator\OnBuildGenerator\bin\Release\MappingGenerator.OnBuildGenerator.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<DeployExtension Condition="'$(AppVeyor)' != ''">False</DeployExtension>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -107,10 +105,6 @@
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.7.4\analyzers\cs\Microsoft.VisualStudio.SDK.Analyzers.dll" />
<Analyzer Include="..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.17\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<Reference Include="Pluralize.NET, Version=0.1.84.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Pluralize.NET.0.1.84\lib\net46\Pluralize.NET.dll</HintPath>
Expand All @@ -119,12 +113,10 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.17\build\Microsoft.VisualStudio.Threading.Analyzers.targets" Condition="Exists('..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.17\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.17\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.17\build\Microsoft.VisualStudio.Threading.Analyzers.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.7.109\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.7.109\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.7.109\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.7.109\build\Microsoft.VSSDK.BuildTools.targets'))" />
</Target>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Description
Extension that allows you to easily generate an implementation for mapping methods. This generator mimics well known AutoMapper. No more dull code typing. [Check the full list of features](https://github.com/cezarypiatek/MappingGenerator).

## Further Development
If you find this extension useful (you feel it helps you on the daily basis) you can support further development by buying me a coffee (it's simple, just click the button below and follow further instructions). Sometimes it's hard to stay awake till midnight implementing new features, coffee helps me with that. I really appreciate your support in any form.

[![](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/tmAJLYvWy)

![](https://github.com/cezarypiatek/MappingGenerator/raw/master/doc/pure_mapping_method_newone.gif)


Release notes: [MappingGenerator releases](https://github.com/cezarypiatek/MappingGenerator/releases)
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VisualStudio.SDK.Analyzers" version="15.7.4" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Threading.Analyzers" version="15.7.17" targetFramework="net461" />
<package id="Microsoft.VSSDK.BuildTools" version="15.7.109" targetFramework="net461" developmentDependency="true" />
<package id="Pluralize.NET" version="0.1.84" targetFramework="net461" />
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "http://json.schemastore.org/vsix-publish",
"categories": [
"coding",
"scaffolding"
],
"identity": {
"internalName": "mappinggenerator"
},
"overview": "overview.md",
"priceCategory": "free",
"publisher": "54748ff9-45fc-43c2-8ec5-cf7912bc3b84",
"private": false,
"qna": true,
"repo": "https://github.com/cezarypiatek/MappingGenerator"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<Description xml:space="preserve">Roslyn based code fix provider that allows to generate mapping code in design time.</Description>
<Icon>preview.png</Icon>
<PreviewImage>preview.png</PreviewImage>
<Tags>automapper, code-generator, mapper, roslyn</Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,)" />
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0, 17.0)" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

<PropertyGroup>
<PackageId>MappingGenerator</PackageId>
<PackageVersion>2.0.0.0</PackageVersion>
<Authors>Cezary Piątek</Authors>
<PackageLicenseUrl>https://github.com/cezarypiatek/MappingGenerator/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/cezarypiatek/MappingGenerator</PackageProjectUrl>
Expand All @@ -20,8 +19,7 @@
<PackageReleaseNotes></PackageReleaseNotes>
<Copyright>Copyright</Copyright>
<PackageTags>MappingGenerator, analyzers</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<Version>2.0.0</Version>
<NoPackageAnalysis>true</NoPackageAnalysis>
<LangVersion>8.0</LangVersion>
</PropertyGroup>

Expand All @@ -31,18 +29,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Asyncify" Version="0.9.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.7.56">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.8.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Features" Version="2.0.0" PrivateAssets="all" />
<PackageReference Include="Pluralize.NET" Version="0.1.84" PrivateAssets="all" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<Version>2.0.0.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>MappingGenerator.OnBuildGenerator</PackageId>
<Authors>Cezary Piątek</Authors>
Expand Down

0 comments on commit 9f93744

Please sign in to comment.