Skip to content

Commit 74abd24

Browse files
diogo-strubeprince-chrismcThalhammer
authored
NuGet Pkg using GitHub Actions (#262)
This PR is related to discussion #243 and is a 3 file contribution: - `nuget\jwt-cpp.nuspec` contains all the descriptions of the NuGet package, including authors, and the path of files to be copied. - `nuget\jwt-cpp.targets` automatically set up the "additional include directories" when the package is installed. - `.github\workflows\nuget.yml` contains the GitHub Action to pack and pub the NuGet package. Co-authored-by: Diogo Strube de Lima <diogo.strube.lima@gmail.com> Co-authored-by: Chris Mc <prince.chrismc@gmail.com> Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
1 parent aac4b62 commit 74abd24

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.github/workflows/nuget.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Nuget
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
11+
jobs:
12+
# This workflow contains a single job called "build"
13+
build:
14+
# The type of runner that the job will run on
15+
runs-on: ubuntu-latest
16+
17+
# Steps represent a sequence of tasks that will be executed as part of the job
18+
steps:
19+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
20+
- uses: actions/checkout@v3
21+
with:
22+
ref: 'v0.6.0'
23+
24+
# Deploy NuGet so we can call the pack and push cmds
25+
- name: Setup NuGet.exe for use with actions
26+
uses: NuGet/setup-nuget@v1.0.7
27+
with:
28+
nuget-api-key: ${{ secrets.nuget_api_key }}
29+
30+
# Package the nusepc file
31+
- name: Create NuGet pkg
32+
working-directory: ./nuget
33+
run: nuget pack jwt-cpp.nuspec
34+
35+
# Publish nuget pkg
36+
- name: Publish NuGet pkg
37+
working-directory: ./nuget
38+
run: nuget push *.nupkg -Source 'https://api.nuget.org/v3/index.json'
39+

nuget/jwt-cpp.nuspec

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package>
3+
<metadata>
4+
<id>jwt-cpp</id>
5+
<version>0.6.0-dev0.2</version>
6+
<authors>Thalhammer; prince-chrismc</authors>
7+
<owners>Thalhammer; prince-chrismc</owners>
8+
<projectUrl>https://github.com/Thalhammer/jwt-cpp</projectUrl>
9+
<description>JWT++ is a header only library for creating and validating JSON Web Tokens in C++11. This library supports all the algorithms defined by the JWT specifications, and the modular design allows to easily add additional algorithms without any problems. In the name of flexibility and extensibility, jwt-cpp supports OpenSSL, LibreSSL, and wolfSSL. And there is no hard dependency on a JSON library.
10+
</description>
11+
<releaseNotes>Supporting OpenSSL 3.0.0, WolfSSL, Hunter CMake, Boost.JSON, JWKs, ES256K.</releaseNotes>
12+
<license type="expression">MIT</license>
13+
<copyright>Copyright (c) 2018 Dominik Thalhammer</copyright>
14+
<title>JWT++: JSON Web Tokens in C++11</title>
15+
<summary>JWT++; a header only library for creating and validating JSON Web Tokens in C++11.</summary>
16+
<tags>JWT, json, web, token, C++, header-only</tags>
17+
<dependencies>
18+
<group targetFramework="native0.0">
19+
<dependency id="PicoJSON" version="1.3.0" />
20+
<dependency id="openssl-vc141-static-x86_64" version="1.1.0" />
21+
</group>
22+
</dependencies>
23+
</metadata>
24+
<files>
25+
<file src="..\include\jwt-cpp\**" target="\lib\native\include\jwt-cpp\" />
26+
<file src="jwt-cpp.targets" target="\build\native\" />
27+
<file src="..\README.md" target="docs\" />
28+
</files>
29+
</package>

nuget/jwt-cpp.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
3+
<ItemDefinitionGroup>
4+
<ClCompile>
5+
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\lib\native\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
6+
</ClCompile>
7+
</ItemDefinitionGroup>
8+
</Project>

0 commit comments

Comments
 (0)