Skip to content

Commit

Permalink
Adding build pipeline for the net6 branch to push Core and Skia.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstancombe committed Dec 9, 2023
1 parent 1965791 commit f1441cf
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 29 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#Builds on every commit to main.
name: CI Build

on:
push:
branches: [ features/net60 ]
pull_request:
branches: [ features/net60 ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore Source/HtmlRenderer.sln

- name: Debug Build
run: dotnet build Source/HtmlRenderer.sln --no-restore -p:Version=${{ format('0.9.{0}', github.run_number) }}
68 changes: 68 additions & 0 deletions .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release

on:
push:
tags: [ v* ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

#Extract the version from the github tag
- id: version
run: echo "::set-output name=version_str::`echo "${{ github.ref }}" | sed -n 's/.*v\(.*\)/\1/p'`"

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: TODO - Document Changes for Tagged Release
draft: true
prerelease: ${{ contains(steps.version.outputs.version_str, '-') }}

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore Source/HtmlRenderer.sln

- name: Release Build
run: dotnet build --no-restore Source/HtmlRenderer.sln -c Release -p:Version=${{ steps.version.outputs.version_str }}

- name: Pack
run: dotnet pack 'Source/HtmlRenderer.sln' --include-symbols --include-source --no-build -c Release -p:Version=${{ steps.version.outputs.version_str }} -p:SymbolPackageFormat=snupkg -o dist

- name: Add Nuget Packages as Release Asset
id: upload-release-asset-core
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/ThreeCS.HtmlRenderer.${{ steps.version.outputs.version_str }}.nupkg
asset_name: ThreeCS.HtmlRenderer.${{ steps.version.outputs.version_str }}.nupkg
asset_content_type: application/octet-stream

- name: Add Skia Nuget Packages as Release Asset
id: upload-release-asset-skia
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/ThreeCS.HtmlRenderer.SkiaSharp.${{ steps.version.outputs.version_str }}.nupkg
asset_name: ThreeCS.HtmlRenderer.SkiaSharp.${{ steps.version.outputs.version_str }}.nupkg
asset_content_type: application/octet-stream

- name: Push to Nuget
run: dotnet nuget push dist/ThreeCS.HtmlRenderer.*.${{ steps.version.outputs.version_str }}.nupkg --api-key ${{ secrets.NUGET_ORG_MSTANCOMBE_KEY }} --source https://api.nuget.org/v3/index.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ UpgradeLog*.XML

Source/.vs/
/Source/Demos/HtmlRenderer.Demo.Console/Output
dist/
24 changes: 13 additions & 11 deletions Source/HtmlRenderer.SkiaSharp/HtmlRenderer.SkiaSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>ThreeCS.HtmlRenderer.SkiaSharp</PackageId>
<Description>Skia Sharp target for HtmlRenderer.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.88.6" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.88.6" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\HtmlRenderer\HtmlRenderer.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HtmlRenderer\HtmlRenderer.csproj" />
</ItemGroup>

</Project>
36 changes: 19 additions & 17 deletions Source/HtmlRenderer/HtmlRenderer.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<PackageId>ThreeCS.HtmlRenderer</PackageId>
<Description>'new' .net port of HtmlRenderer. Would be nice to merge back to arthub one day.</Description>
</PropertyGroup>

<ItemGroup>
<None Remove="Core\Utils\ImageError.png" />
<None Remove="Core\Utils\ImageLoad.png" />
</ItemGroup>
<ItemGroup>
<None Remove="Core\Utils\ImageError.png" />
<None Remove="Core\Utils\ImageLoad.png" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Core\Utils\ImageError.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Core\Utils\ImageLoad.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Core\Utils\ImageError.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Core\Utils\ImageLoad.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Source/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[assembly: AssemblyTitle("HTML Renderer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Open source hosted on CodePlex")]
[assembly: AssemblyCompany("Open source hosted on Github")]
[assembly: AssemblyProduct("HTML Renderer")]
[assembly: AssemblyCopyright("Copyright © 2008")]
[assembly: AssemblyTrademark("")]
Expand Down

0 comments on commit f1441cf

Please sign in to comment.