Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NuGet Pkg for v0.6.0 using GitHub Actions #262

Merged
merged 14 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This is a basic workflow to help you get started with Actions

name: Nuget

# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered using https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release so that it will get pushed automatically?

I do like manual so we can test but less is more 😉

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think manual is fine while we test, we can switch it later once we are more familiar with how it works.


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
ref: 'v0.6.0'

# Deploy NuGet so we can call the pack and push cmds
- name: Setup NuGet.exe for use with actions
uses: NuGet/[email protected]
with:
nuget-api-key: ${{ secrets.nuget_api_key }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need access to the Nuget package to make an API token? I made an account with the same user name if you don't mind :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, he needs to add one of us (or ideally both) as a owner for the package and we then need to create a secret here with the push token.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are the only one who can add secrets AFAIK, I dont have access to the settings page where they can be added

(my evil genius plan to steal power is working muahahah 😈 )

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont have access to the settings page where they can be added

Guess I need to add them myself then 😈

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added you both access as owners directly via NuGet.org so you can manage the package even before we publish the next one:
image
And the next commit will have you both added as owners in the .nuspec file, together with the version updated to a test one so you can experiment with running the workflow with your own token :)


# Package the nusepc file
- name: Create NuGet pkg
working-directory: ./nuget
run: nuget pack jwt-cpp.nuspec

# Publish nuget pkg
- name: Publish NuGet pkg
working-directory: ./nuget
run: nuget push *.nupkg -Source 'https://api.nuget.org/v3/index.json'

29 changes: 29 additions & 0 deletions nuget/jwt-cpp.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>jwt-cpp</id>
<version>0.6.0</version>
<authors>Dominik Thalhammer; Chris Mc</authors>
<owners>Dominik Thalhammer; Chris Mc</owners>
<projectUrl>https://github.com/Thalhammer/jwt-cpp</projectUrl>
<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.
</description>
<releaseNotes>Supporting OpenSSL 3.0.0, WolfSSL, Hunter CMake, Boost.JSON, JWKs, ES256K.</releaseNotes>
<license type="expression">MIT</license>
<copyright>Copyright (c) 2018 Dominik Thalhammer</copyright>
<title>JWT++: JSON Web Tokens in C++11</title>
<summary>JWT++; a header only library for creating and validating JSON Web Tokens in C++11.</summary>
<tags>JWT, json, web, token, C++, header-only</tags>
<dependencies>
<group targetFramework="native0.0">
<dependency id="PicoJSON" version="1.3.0" />
<dependency id="openssl-vc141-static-x86_64" version="1.1.0" />
</group>
</dependencies>
</metadata>
<files>
<file src="..\include\jwt-cpp\**" target="\lib\native\include\jwt-cpp\" />
<file src="jwt-cpp.targets" target="\build\native\" />
<file src="..\README.md" target="docs\" />
</files>
</package>
8 changes: 8 additions & 0 deletions nuget/jwt-cpp.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\lib\native\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
</Project>