Skip to content

Commit

Permalink
Switch to packages.lock, publish via github actions instead of appveyor
Browse files Browse the repository at this point in the history
Also refactor Directory.Build.Props
  • Loading branch information
lilith committed Aug 23, 2022
1 parent 1a8a327 commit ca26aa3
Show file tree
Hide file tree
Showing 31 changed files with 16,549 additions and 49 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,48 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]

release:
types: [ published ]

jobs:
build:
strategy:
matrix:
include:
- name: ubuntu-20.04
os: ubuntu-20.04
handles-release: true

- name: osx_11.0-x86_64
os: macos-11.0

- name: win-x86_64
os: windows-2019
os: windows-latest

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'

- name: Set the release version (if applicable)
run: |
echo "TAGGED_VERSION=${{ steps.version.outputs.full_without_prefix }}" >> $GITHUB_ENV
echo Set version to ${{ steps.version.outputs.full_without_prefix }}
shell: bash
if: steps.version.outputs.is_valid == 'true' && github.event_name == 'release'


- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
Expand All @@ -33,9 +57,18 @@ jobs:
dotnet-version: '3.1.x'
- run: dotnet clean --configuration Release
- run: dotnet nuget locals all --clear
- name: Install dependencies
run: dotnet restore
- name: Restore packages
run: dotnet restore -v quiet
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
run: dotnet test --configuration Release --no-restore --verbosity normal --filter "FullyQualifiedName!~SkipOnCI"

- name: Pack
run: dotnet pack -c Release --include-source
if: matrix.handles-release == 'true'

- name: Publish nuget packages to Nuget.org (if a release)
if: steps.version.outputs.is_valid == 'true' && github.event_name == 'release' && matrix.handles-release == 'true'
run: |
dotnet nuget push bin\Release\*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}
58 changes: 58 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,62 @@
<ItemGroup>
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
</ItemGroup>

<PropertyGroup>
<Copyright>Copyright © 2022 Imazen LLC</Copyright>
<PackageProjectUrl>https://github.com/imazen/imageflow-dotnet-server</PackageProjectUrl>
<RepositoryUrl Condition="'$(GITHUB_REPOSITORY)' != ''">$(GITHUB_SERVER_URL)/$(GITHUB_REPOSITORY)</RepositoryUrl>
<SourceRevisionId Condition="'$(SourceRevisionId)' == ''">$(GITHUB_SHA)</SourceRevisionId>
<RepositoryBranch>main</RepositoryBranch>
<Authors>imazen,lilith</Authors>
<Owners>imazen,lilith</Owners>
<Company>Imazen</Company>
<CompanyName>Imazen</CompanyName>
<Product>Imageflow Server</Product>
<RepositoryType>git</RepositoryType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<Version Condition="'$(Version)' == ''">$(TAGGED_VERSION)</Version>
<VersionPrefix>0.1.0</VersionPrefix>
<VersionSuffix>-notset</VersionSuffix>

<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup>
<PackageTags>Image;Resize;Optimize;Crop;Gif;Jpg;Jpeg;Bitmap;Png;Core;WebP;ImageResizer;Imageflow;Rotate;Imaging;Crunch</PackageTags>
<PackageLicenseExpression>AGPL-3.0-or-later</PackageLicenseExpression>
</PropertyGroup>


<PropertyGroup Condition="'$(CI)' == 'True'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<RestoreLockedMode>true</RestoreLockedMode>
</PropertyGroup>
<PropertyGroup Condition="'$(CI)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<RestoreLockedMode>true</RestoreLockedMode>
</PropertyGroup>

<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<NoWarn>NU1603</NoWarn>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
<PropertyGroup>
<IntermediateOutputPath>$(SolutionDir)\obj\$(Configuration)</IntermediateOutputPath>
<OutputPath>$(SolutionDir)\bin\$(Configuration)</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="!$(MSBuildProjectName.EndsWith('Tests'))">
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>


<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>
16 changes: 8 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ test_script:
- dotnet build --configuration Release
- dotnet test

deploy:
- provider: NuGet
api_key:
secure: foE8EFenV6miA8Ox223Ag+ThJ4k6MF1hnZnsMcgbpk9L3gUkMoPcbZY02twSTiYL
skip_symbols: false
artifact: /.*(\.|\.s)nupkg/
on:
appveyor_repo_tag: true
#deploy:
# - provider: NuGet
# api_key:
# secure: foE8EFenV6miA8Ox223Ag+ThJ4k6MF1hnZnsMcgbpk9L3gUkMoPcbZY02twSTiYL
# skip_symbols: false
# artifact: /.*(\.|\.s)nupkg/
# on:
# appveyor_repo_tag: true
Loading

0 comments on commit ca26aa3

Please sign in to comment.