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

Conversation

diogo-strube
Copy link
Contributor

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.

Some context on the current approach:

  • As the version is already tracked by committed files (as shown in 🏷️ Set version to 0.6.0 #208), I left the version explicit in the .nuspec file (instead of using an environment variable or secret).
  • Publishing a NuGet pkg (to nugte.org) requires a token, the same was configured as a secret ${{ secrets.nuget_api_key }} in .github\workflows\nuget.yml.

# 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.

- 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 :)

@prince-chrismc
Copy link
Collaborator

Looks super good just a few questions

@diogo-strube
Copy link
Contributor Author

@Thalhammer and @prince-chrismc, with the latest commit you should be ready to configure the secret and try running the workflow, it will generate a pre-release package "-dev0.2" that we can do a final validation before publishing the release package.

@Thalhammer
Copy link
Owner

@prince-chrismc Can you create a token for nuget ?
I can't cause I am not a co owner of the package but you seem to be now.

@prince-chrismc
Copy link
Collaborator

should be in you inbox :)

@Thalhammer Thalhammer merged commit 74abd24 into Thalhammer:master Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants