Skip to content

Commit

Permalink
Switch to GitHub Actions (#59)
Browse files Browse the repository at this point in the history
* enable gh actions
* fix yaml
* fix markdown
* remove travis config
* change duplicated headline in readme
* Only build test project with 5.0
* remove traces of travis ci
* include release

Co-authored-by: Santiago Traversa <[email protected]>
  • Loading branch information
OleMchls and san983 authored Oct 18, 2021
1 parent ae14c96 commit 70a0caf
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 58 deletions.
21 changes: 11 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
version: 2
updates:
- package-ecosystem: nuget
directory: /
schedule:
interval: daily
time: '12:00'
open-pull-requests-limit: 10
labels:
- task
- dependencies
- backlog-dependencies
- package-ecosystem: nuget
directory: /
schedule:
interval: daily
time: '12:00'
open-pull-requests-limit: 10
labels:
- task
- dependencies
- backlog-dependencies
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: ci

"on":
pull_request:
push:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
markdownlint-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Run markdownlint-cli
uses: nosborn/[email protected]
with:
files: .
config_file: ".markdownlint.yaml"

yamllint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Run YAML Lint
uses: actionshub/yamllint@main

build:
needs: [markdownlint-cli, yamllint]
runs-on: ubuntu-latest
name: .NET ${{ matrix.dotnet-version }}
strategy:
matrix:
dotnet-version:
- '5.0.x'
steps:
- uses: actions/checkout@v2
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal

release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Pack
run: dotnet pack /p:PackageVersion=${VERSION}

slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs:
- build
- release
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL_DEVELOPMENT}}
3 changes: 3 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
default: true
line-length: false
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This project uses [Semantic Versioning 2.0.0](http://semver.org/).

## main

- CHANGED: Added support for DS record key-data interface (dnsimple/dnsimple-chsarp#58)

## 0.12.0
Expand Down
20 changes: 14 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
# Contributing to DNSimple/C#
# Contributing to DNSimple/C\#

## Getting Started

#### 1. Clone the repository
### 1. Clone the repository

Clone the repository and move into it:

```shell
git clone [email protected]:dnsimple/dnsimple-csharp.git
cd dnsimple-csharp
```

#### 2. Install dependencies
### 2. Install dependencies

- .NET Core SDK

From https://dotnet.microsoft.com/download/
From [https://dotnet.microsoft.com/download/](https://dotnet.microsoft.com/download/)

You can either use to install the .NET Core SDK
- Installers
- Binaries
- [Scripts](https://dotnet.microsoft.com/download/dotnet/scripts)
- Install [Visual Studio](https://visualstudio.microsoft.com/)

#### 3. Build and test
### 3. Build and test

[Run the test suite](#testing) to check everything is working as expected and to install the project specific
dependencies (the first time you'll run the script it will install all the dependencies for you).
Expand All @@ -41,21 +42,28 @@ The following instructions uses $VERSION as a placeholder, where $VERSION is a M
1. Update `PackageReleaseNotes` in `dnsimple.csproj` (located in `./src/dnsimple`).
1. Finalize the `## main` section in `CHANGELOG.md` assigning the version.
1. Commit and push the changes

```shell
git commit -a -m "Release $VERSION"
git push origin main
```

1. Wait for the CI to complete.
1. Create a signed tag.

```shell
git tag -a v$VERSION -s -m "Release $VERSION"
git push origin --tags
```

1. Create the NuGet Package

```shell
dotnet pack /p:PackageVersion=$VERSION -c Release
```

1. Upload the package to [NuGet](https://www.nuget.org/) by using the web interface or pushing the package

```shell
dotnet nuget push ./src/dnsimple/bin/Release/DNSimple.$VERSION.nupkg -k <TOKEN> -s https://api.nuget.org/v3/index.json
```
Expand All @@ -64,4 +72,4 @@ The following instructions uses $VERSION as a placeholder, where $VERSION is a M

Submit unit tests for your changes. You can test your changes on your machine by [running the test suite](#testing).

When you submit a PR, tests will also be run on the [continuous integration environment via Travis](https://travis-ci.com/dnsimple/dnsimple-csharp).
When you submit a PR, tests will also be run on the [continuous integration environment via GitHub Actions](https://github.com/dnsimple/dnsimple-csharp/actions).
20 changes: 1 addition & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A C# client for the [DNSimple API v2](https://developer.dnsimple.com/v2/).

[![Build Status](https://travis-ci.com/dnsimple/dnsimple-csharp.svg?branch=main)](https://travis-ci.com/dnsimple/dnsimple-csharp)
[![Build Status](https://github.com/dnsimple/dnsimple-csharp/actions/workflows/ci.yml/badge.svg)](https://github.com/dnsimple/dnsimple-csharp/actions/workflows/ci.yml)
[![NuGet version](https://badge.fury.io/nu/dnsimple.svg)](https://badge.fury.io/nu/dnsimple)

## :warning: Development Warning
Expand All @@ -23,21 +23,6 @@ Where `<version>` denotes the version of the client you want to install.
PM> Install-Package DNSimple -Version <version>
```

### .NET CLI

```shell
> dotnet add package DNSimple --version <version>
```

### .NET CLI

Note: Replace `X.Y.Z` with the actual version.

```xml
<PackageReference Include="DNSimple" Version="X.Y.Z" />
```


## Usage

This library is a C# client you can use to interact with the [DNSimple API v2](https://developer.dnsimple.com/v2/). Here are some examples.
Expand Down Expand Up @@ -97,7 +82,6 @@ var domainId = client.Domains.ListDomains(accountId).Data.First().Id;
var domain = client.Domains.GetDomain(accountId, domainId).Data;
```


## Sandbox Environment

We highly recommend testing against our [sandbox environment](https://developer.dnsimple.com/sandbox/) before using our production environment.
Expand All @@ -116,7 +100,6 @@ client.AddCredentials(credentials);

You will need to ensure that you are using an access token created in the sandbox environment. Production tokens will *not* work in the sandbox environment.


## Setting a custom `User-Agent` header

You can customize the `User-Agent` header for the calls made to the DNSimple API:
Expand All @@ -130,7 +113,6 @@ The value you provide will be prepended to the default `User-Agent` the client u

We recommend to customize the user agent. If you are building a library or integration on top of the official client, customizing the client will help us to understand what is this client used for, and allow to contribute back or get in touch.


## License

Copyright (c) 2021 DNSimple Corporation. This is Free Software distributed under the MIT license.
2 changes: 1 addition & 1 deletion src/dnsimple-test/dnsimple-test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net50</TargetFrameworks>
<TargetFrameworks>net50</TargetFrameworks>
<RootNamespace>dnsimple_test</RootNamespace>

<IsPackable>false</IsPackable>
Expand Down

0 comments on commit 70a0caf

Please sign in to comment.