Skip to content

Commit

Permalink
Change CI from Travis to GitHub Actions (#16)
Browse files Browse the repository at this point in the history
* Create dotnet.yml
* Remove usage of PackageIconUrl
* Update test project to netCoreApp3.1
* Remove travis.yml
* Update package version
* Update badge
  • Loading branch information
FObermaier committed Apr 12, 2021
1 parent d859a1c commit 5f51421
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 42 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: .NET

on: [push, pull_request]

jobs:
pack:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]

steps:
- name: Get source
uses: actions/checkout@v2

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.406

- name: Build
run: dotnet build -c Release -v minimal -p:WarningLevel=3

- name: Test
run: dotnet test -c Release --no-build -v normal

- name: Pack
run: dotnet pack -c Release --no-build -o artifacts -p:NoWarn=NU5105

- name: Upload
uses: actions/upload-artifact@v2
with:
name: NuGet Package Files (${{ matrix.os }})
path: artifacts

deployToMyGet:
name: Deploy to MyGet
runs-on: ubuntu-latest

needs: pack
if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')

steps:
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.406

- name: Download Package Files
uses: actions/download-artifact@v2
with:
name: NuGet Package Files (ubuntu-latest)
path: artifacts

- name: Publish Package Files to MyGet
run: dotnet nuget push artifacts/*.nupkg -s https://www.myget.org/F/nettopologysuite/api/v3/index.json -k $MYGET_API_KEY
shell: bash
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}

deployToNuGet:
name: Deploy to NuGet
runs-on: ubuntu-latest

needs: pack
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

steps:
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.406

- name: Download Package Files
uses: actions/download-artifact@v2
with:
name: NuGet Package Files (ubuntu-latest)
path: artifacts

- name: Publish Package Files to NuGet
run: dotnet nuget push artifacts/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY
shell: bash
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<LangVersion>7.3</LangVersion> <!-- latest version supported by VS2017 -->

<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)nts.snk</AssemblyOriginatorKeyFile>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# NetTopologySuite.IO.SqlServerBytes
A SQL Server IO module for NTS which works directly with the serialization format

| License | Travis | NuGet | MyGet (pre-release) |
| License | Actions | NuGet | MyGet (pre-release) |
| ------- | ------ | ----- | ------------------- |
| [![License](https://img.shields.io/github/license/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes.svg)](https://github.com/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes/blob/master/LICENSE) | [![Travis](https://travis-ci.org/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes.svg?branch=master)](https://travis-ci.org/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes) | [![NuGet](https://img.shields.io/nuget/v/NetTopologySuite.IO.SqlServerBytes.svg)](https://www.nuget.org/packages/NetTopologySuite.IO.SqlServerBytes/) | [![MyGet](https://img.shields.io/myget/nettopologysuite/vpre/NetTopologySuite.IO.SqlServerBytes.svg?style=flat)](https://myget.org/feed/nettopologysuite/package/nuget/NetTopologySuite.IO.SqlServerBytes) |
| [![License](https://img.shields.io/github/license/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes.svg)](https://github.com/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes/blob/master/LICENSE) | [![.NET](https://github.com/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes/actions/workflows/dotnet.yml/badge.svg)](https://github.com/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes/actions/workflows/dotnet.yml) | [![NuGet](https://img.shields.io/nuget/v/NetTopologySuite.IO.SqlServerBytes.svg)](https://www.nuget.org/packages/NetTopologySuite.IO.SqlServerBytes/) | [![MyGet](https://img.shields.io/myget/nettopologysuite/vpre/NetTopologySuite.IO.SqlServerBytes.svg?style=flat)](https://myget.org/feed/nettopologysuite/package/nuget/NetTopologySuite.IO.SqlServerBytes) |

## Usage

Expand Down
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">ci.travis.$(TRAVIS_BUILD_NUMBER)</NtsBuildMetadata>

<NtsOfficialRelease Condition=" '$(TRAVIS_BRANCH)' == 'master' And '$(TRAVIS_PULL_REQUEST)' == 'false' ">true</NtsOfficialRelease>
</PropertyGroup>

<!-- TeamCity -->
Expand All @@ -30,6 +29,15 @@
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">ci.appveyor.$(APPVEYOR_BUILD_NUMBER)</NtsBuildMetadata>
</PropertyGroup>

<!-- GitHub Actions -->
<PropertyGroup Condition=" '$(GITHUB_ACTIONS)' == 'True' ">
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">ci.github.$(GITHUB_ACTION)</NtsBuildMetadata>

<NtsOfficialRelease Condition=" '$(GITHUB_REF)' == 'refs/heads/master' And '$(GITHUB_EVENT_NAME)' == 'push' ">true</NtsOfficialRelease>
</PropertyGroup>

<!-- Fallback for local builds and CI environments we don't recognize -->
<PropertyGroup>
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">local</NtsBuildMetadata>
Expand All @@ -38,7 +46,7 @@
<PropertyGroup Label="Version numbers">
<!-- MAJOR, MINOR, and PATCH are defined according to SemVer 2.0.0. -->
<NtsMajorVersion>2</NtsMajorVersion>
<NtsMinorVersion>0</NtsMinorVersion>
<NtsMinorVersion>1</NtsMinorVersion>
<NtsPatchVersion>0</NtsPatchVersion>

<NtsBuildTimestamp>$([System.DateTime]::UtcNow.Ticks)</NtsBuildTimestamp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
<PackageProjectUrl>https://github.com/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes</PackageProjectUrl>
<RepositoryUrl>https://github.com/NetTopologySuite/NetTopologySuite.IO.SqlServerBytes.git</RepositoryUrl>
<PackageTags>NTS;MSSQL;SQLServer;SQL Server;SQL</PackageTags>
<PackageIconUrl>https://raw.githubusercontent.com/NetTopologySuite/GeoAPI/master/icon.png</PackageIconUrl>
<iconUrl>https://raw.githubusercontent.com/NetTopologySuite/GeoAPI/develop/icon.png</iconUrl>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

Expand Down

0 comments on commit 5f51421

Please sign in to comment.