Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
romfir authored and Damian Romanowski committed Sep 8, 2023
1 parent 3cb5f7b commit 34473a6
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 7 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build

on:
workflow_dispatch:
push:
pull_request:
release:
types:
- published

env:
PACKAGE_NAME: OpenApiLINQPadDriver
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
SLN: OpenApiLINQPadDriver.sln
CONFIGURATION: Release
RETENTION_DAYS: 1
NUGET_DIRECTORY: ${{ github.workspace }}/nuget

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x.x
7.x.x
- name: Restore dependencies
run: dotnet restore ${{ env.SLN }}

- name: ${{ env.SLN }} ${{ env.CONFIGURATION }} Build
run: dotnet build ${{ env.SLN }} --no-restore --configuration ${{ env.CONFIGURATION }} -p:GITHUB_ACTIONS=true

- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}
if-no-files-found: error
path: |
${{ env.PACKAGE_NAME }}/bin/${{ env.CONFIGURATION }}/${{ env.PACKAGE_NAME }}.*.*nupkg
retention-days: ${{ env.RETENTION_DAYS }}

deploy:
if: github.event_name == 'release'
runs-on: windows-latest
needs: [ build ]
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}
path: ${{ env.NUGET_DIRECTORY }}

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x.x
7.x.x
- name: Publish NuGet package
run: |
foreach($file in (Get-ChildItem "${{ env.NUGET_DIRECTORY }}" -Recurse -Include ${{ env.PACKAGE_NAME }}.*nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
2 changes: 1 addition & 1 deletion OpenApiLINQPadDriver/ConnectionDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
x:ClassModifier="internal"
mc:Ignorable="d"
Title="Open API Connection"
Icon="/OpenApiContextDriver;component/openapi.ico"
Icon="/OpenApiLINQPadDriver;component/openapi.ico"
Background="{x:Static SystemColors.ControlBrush}"
Width="660"
Height="310"
Expand Down
14 changes: 8 additions & 6 deletions OpenApiLINQPadDriver/OpenApiLINQPadDriver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</PropertyGroup>

<PropertyGroup>
<AssemblyName>OpenApiContextDriver</AssemblyName>
<Version>0.0.1</Version>
<AssemblyName>OpenApiLINQPadDriver</AssemblyName>
<Version>0.0.1-alpha</Version>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Authors>Damian Romanowski ([email protected])</Authors>
<Copyright>Copyright © Damian Romanowski 2023-$([System.DateTime]::Now.Year)</Copyright>
Expand All @@ -25,9 +25,9 @@
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<PackageTags>linqpaddriver swagger openapi</PackageTags>
<PackageProjectUrl>https://github.com/i2van/CsvLINQPadDriver</PackageProjectUrl>
<PackageProjectUrl>https://github.com/romfir/OpenApiLINQPadDriver</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/i2van/CsvLINQPadDriver</RepositoryUrl>
<RepositoryUrl>https://github.com/romfir/OpenApiLINQPadDriver</RepositoryUrl>
<PackageIcon>NuGetIcon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand All @@ -36,11 +36,13 @@
<IncludeSymbols>true</IncludeSymbols>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EnablePackageValidation>true</EnablePackageValidation>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<!--uncomment for local development (and pick only one TargetFramework)-->
<!--<PropertyGroup>
<OutputPath>$(localappdata)\LINQPad\Drivers\DataContext\NetCore\OpenApiContextDriver</OutputPath>
<OutputPath>$(localappdata)\LINQPad\Drivers\DataContext\NetCore\OpenApiLINQPadDriver</OutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
Expand Down Expand Up @@ -88,7 +90,7 @@
<Resource Include="OpenAPI.ico" />
<Content Include="../README.md">
<Pack>true</Pack>
<PackagePath/>
<PackagePath />
</Content>
</ItemGroup>

Expand Down

0 comments on commit 34473a6

Please sign in to comment.