Skip to content

Commit

Permalink
Add Project authoring, add github actions for NuGet version releases
Browse files Browse the repository at this point in the history
  • Loading branch information
kev-le committed Oct 26, 2023
1 parent 53624ea commit dd10514
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Studio Client .NET NuGet Release'

on:
push:
tags:
- 'v*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
env:
PROJECT_PATH: 'StudioClient/StudioClient.csproj'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: Build
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release

- name: 'Get Version'
id: version
uses: battila7/get-version-action@v2

- name: Pack
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: Nuget Push
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -s ${{ env.NUGET_SOURCE_URL }} -k ${{ env.NUGET_API_KEY }} --skip-duplicate
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var api = new StudioClient("YOUR_SKYLAB_API_TOKEN");

### Error Handling

By default, the API calls return a JSON response object no matter the type of response.
By default, the API calls return a JSON (JObject) response object no matter the type of response.

### Endpoints

Expand Down
13 changes: 10 additions & 3 deletions StudioClient/StudioClient.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>SkylabStudio</PackageId>
<PackageTitle>Skylab Studio Client</PackageTitle>
<Version>0.0.1</Version>
<Description>.NET client to interface with Skylab Studio Public API</Description>
<Company>Skylab Technologies Inc.</Company>
<Authors>skylabtech</Authors>
<PackageProjectUrl>https://github.com/skylab-tech/studio_client_dotnet</PackageProjectUrl>
<PackageIconUrl>https://avatars.githubusercontent.com/u/45469060?s=48&v=4</PackageIconUrl>
<PackageTags>studio skylab skylabtech api library .net nuget</PackageTags>
<Copyright>Copyright (c) Skylab Technologies Inc.</Copyright>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit dd10514

Please sign in to comment.