Skip to content

Commit

Permalink
ci(): use GitHub actions instead of appveyor & travis (#14)
Browse files Browse the repository at this point in the history
* Add publish and test workflows
* Removes appveyor and travis configurations (no longer needed)
* Updates README with directions on publishing a package

Co-authored-by: Justin M. Keyes <[email protected]>
  • Loading branch information
smolck and justinmk authored Sep 8, 2021
1 parent 929fe43 commit d0a1554
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 82 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish GitHub NuGet package

on:
# no triggers (manual)
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install nvim binary
uses: rhysd/action-setup-vim@v1
if: steps.cache-nvim.outputs.cache-hit != 'true' || steps.cache-nvim-windows.outputs.cache-hit != 'true'
with:
neovim: true
version: nightly

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 5.0.x

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal test/NvimClient.Test/NvimClient.Test.csproj

- name: Publish
run: |
dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/neovim/index.json"
dotnet pack src/NvimClient.API/NvimClient.API.csproj --configuration Release
dotnet nuget push "src/NvimClient.API/bin/Release/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source github
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install nvim binary
uses: rhysd/action-setup-vim@v1
if: steps.cache-nvim.outputs.cache-hit != 'true' || steps.cache-nvim-windows.outputs.cache-hit != 'true'
with:
neovim: true
version: nightly

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal test/NvimClient.Test/NvimClient.Test.csproj
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,9 @@ Run all tests (`nvim` must be in the `PATH`):
Run only the `TestMessageDeserialization` test:

dotnet test --filter TestMessageDeserialization test/NvimClient.Test/NvimClient.Test.csproj

Release
-----

1. Update version as necessary in `src/NvimClient.API/NvimClient.API.csproj`.
2. Run the [publish workflow](https://github.com/neovim/nvim.net/actions/workflows/publish.yml).
68 changes: 0 additions & 68 deletions appveyor.yml

This file was deleted.

2 changes: 2 additions & 0 deletions src/NvimClient.API/NvimClient.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<DocumentationFile>bin\Debug\net5.0\NvimClient.API.xml</DocumentationFile>
<RepositoryUrl>https://github.com/neovim/nvim.net</RepositoryUrl>
<Version>0.20.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit d0a1554

Please sign in to comment.