diff --git a/.github/workflows/pr-verification.yml b/.github/workflows/pr-verification.yml new file mode 100644 index 0000000..60d5207 --- /dev/null +++ b/.github/workflows/pr-verification.yml @@ -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' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cbdcdb0 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/MappingGenerator.Vsix.csproj b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/MappingGenerator.Vsix.csproj index 32f8e86..33f1cad 100644 --- a/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/MappingGenerator.Vsix.csproj +++ b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/MappingGenerator.Vsix.csproj @@ -20,13 +20,11 @@ false true 0 - 1.0.0.%2a false false true - False @@ -107,10 +105,6 @@ true - - - - ..\..\packages\Pluralize.NET.0.1.84\lib\net46\Pluralize.NET.dll @@ -119,12 +113,10 @@ - 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}. - diff --git a/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/overview.md b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/overview.md new file mode 100644 index 0000000..1cc89df --- /dev/null +++ b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/overview.md @@ -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) \ No newline at end of file diff --git a/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/packages.config b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/packages.config index 58c8425..1783931 100644 --- a/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/packages.config +++ b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/packages.config @@ -1,7 +1,5 @@  - - \ No newline at end of file diff --git a/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/publishManifest.json b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/publishManifest.json new file mode 100644 index 0000000..94bcca7 --- /dev/null +++ b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/publishManifest.json @@ -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" +} \ No newline at end of file diff --git a/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/source.extension.vsixmanifest b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/source.extension.vsixmanifest index 7c1f273..180f58e 100644 --- a/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/source.extension.vsixmanifest +++ b/MappingGenerator/MappingGenerator/MappingGenerator.Vsix/source.extension.vsixmanifest @@ -6,9 +6,10 @@ Roslyn based code fix provider that allows to generate mapping code in design time. preview.png preview.png + automapper, code-generator, mapper, roslyn - + diff --git a/MappingGenerator/MappingGenerator/MappingGenerator/MappingGenerator.csproj b/MappingGenerator/MappingGenerator/MappingGenerator/MappingGenerator.csproj index ac94cd3..7a95946 100644 --- a/MappingGenerator/MappingGenerator/MappingGenerator/MappingGenerator.csproj +++ b/MappingGenerator/MappingGenerator/MappingGenerator/MappingGenerator.csproj @@ -9,7 +9,6 @@ MappingGenerator - 2.0.0.0 Cezary Piątek https://github.com/cezarypiatek/MappingGenerator/blob/master/LICENSE https://github.com/cezarypiatek/MappingGenerator @@ -20,8 +19,7 @@ Copyright MappingGenerator, analyzers - true - 2.0.0 + true 8.0 @@ -31,18 +29,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/MappingGenerator/OnBuildGenerator/MappingGenerator.OnBuildGenerator.csproj b/MappingGenerator/OnBuildGenerator/MappingGenerator.OnBuildGenerator.csproj index 74b9293..f3f8bb1 100644 --- a/MappingGenerator/OnBuildGenerator/MappingGenerator.OnBuildGenerator.csproj +++ b/MappingGenerator/OnBuildGenerator/MappingGenerator.OnBuildGenerator.csproj @@ -3,7 +3,6 @@ netcoreapp3.0 true - 2.0.0.0 true MappingGenerator.OnBuildGenerator Cezary Piątek