diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b223569a..eb6f60f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,14 @@ jobs: uses: actions/checkout@v4 - name: 🙏 build - run: dotnet build -m:1 + run: dotnet build -m:1 -bl + + - name: 🐛 logs + uses: actions/upload-artifact@v3 + if: runner.debug && always() + with: + name: logs + path: '*.binlog' - name: ⚙ azurite run: | @@ -41,7 +48,7 @@ jobs: SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} if: env.SLEET_CONNECTION != '' run: | - dotnet tool install -g --version 4.0.18 sleet + dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r) sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found" - name: ⬆️ upload diff --git a/src/Cli/Cli.csproj b/src/Cli/Cli.csproj index 4c4efe32..1355b352 100644 --- a/src/Cli/Cli.csproj +++ b/src/Cli/Cli.csproj @@ -39,4 +39,30 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/Cli/help.md b/src/Cli/help.md new file mode 100644 index 00000000..90ee47fb --- /dev/null +++ b/src/Cli/help.md @@ -0,0 +1,19 @@ +USAGE: + sponsor [OPTIONS] + +OPTIONS: + -h, --help Prints help information + +COMMANDS: + config Manages sponsorlink configuration + init Initializes a sponsorable JWT manifest and signing keys + list Lists current user and organization sponsorships leveraging + the GitHub CLI + remove Removes manifests and notifies issuers to remove backend + data too + sync Synchronizes sponsorship manifests + view Validates and displays the active sponsor manifests, if any + nuget Emits the nuget.json manifest with all contributors to + active nuget packages + check Checks the validity of a GitHub token +``` diff --git a/src/Cli/readme.md b/src/Cli/readme.md index d3fbcdba..f96c2177 100644 --- a/src/Cli/readme.md +++ b/src/Cli/readme.md @@ -8,50 +8,13 @@ sponsor sync devlooped Sync options: -```bash -USAGE: - sponsor sync [account] [OPTIONS] - -ARGUMENTS: - [account] Optional sponsored account(s) to synchronize - -OPTIONS: - -h, --help Prints help information - --autosync Enable or disable automatic synchronization of expired manifests - -l, --local Sync only existing local manifests - -f, --force Force sync, regardless of expiration of manifests found locally - -v, --validate Whether to always validate local manifests using the issuer public key - -u, --unattended Whether to prevent interactive credentials refresh - --with-token Read GitHub authentication token from standard input for sync -``` + Other commands: -```bash -USAGE: - sponsor [OPTIONS] - -OPTIONS: - -h, --help Prints help information - -COMMANDS: - config Manages sponsorlink configuration - init Initializes a sponsorable JWT manifest and signing keys - list Lists current user and organization sponsorships leveraging the GitHub CLI - remove Removes all manifests and notifies issuers to remove backend data too - sync Synchronizes sponsorship manifests - view Validates and displays the active sponsor manifests, if any -``` - - -### Stats - -Active SponsorLink sync usage by sponsorship kind: - -![User](https://img.shields.io/endpoint?color=ea4aaa&url=https%3A%2F%2Fsponsorlink.devlooped.com%2Fbadge%3Fuser) -![Organization](https://img.shields.io/endpoint?color=green&url=https%3A%2F%2Fsponsorlink.devlooped.com%2Fbadge%3Forg) -![Team](https://img.shields.io/endpoint?color=8A2BE2&url=https%3A%2F%2Fsponsorlink.devlooped.com%2Fbadge%3Fteam) -![Contributor](https://img.shields.io/endpoint?color=blue&url=https%3A%2F%2Fsponsorlink.devlooped.com%2Fbadge%3Fcontrib) + Learn more [about the tool](https://github.com/devlooped/SponsorLink/blob/main/docs/github/index.md#sponsor-manifest-sync) and related [telemetry](https://github.com/devlooped/SponsorLink/blob/main/docs/github/index.md#telemetry). + + \ No newline at end of file diff --git a/src/Cli/sync.md b/src/Cli/sync.md new file mode 100644 index 00000000..b51e1b8b --- /dev/null +++ b/src/Cli/sync.md @@ -0,0 +1,21 @@ +DESCRIPTION: +Synchronizes sponsorship manifests + +USAGE: + sponsor sync [account] [OPTIONS] + +ARGUMENTS: + [account] Optional sponsored account(s) to synchronize + +OPTIONS: + -h, --help Prints help information + --autosync Enable or disable automatic synchronization of expired + manifests + -l, --local Sync only existing local manifests + -f, --force Force sync, regardless of expiration of manifests found + locally + -v, --validate Validate local manifests using the issuer public key + -u, --unattended Prevent interactive credentials refresh + --with-token Read GitHub authentication token from standard input for + sync +``` diff --git a/src/Commands/App.cs b/src/Commands/App.cs index c5889c86..db7a6b71 100644 --- a/src/Commands/App.cs +++ b/src/Commands/App.cs @@ -81,6 +81,9 @@ public static CommandApp Create(out IServiceProvider services) #if DEBUG config.AddCommand("check"); #endif + + if (Environment.GetEnvironmentVariables().Contains("NO_COLOR")) + config.Settings.HelpProviderStyles = null; }); services = registrar.Services.BuildServiceProvider(); diff --git a/src/Commands/CheckTokenCommand.cs b/src/Commands/CheckTokenCommand.cs index 5ca6df4b..61fcc340 100644 --- a/src/Commands/CheckTokenCommand.cs +++ b/src/Commands/CheckTokenCommand.cs @@ -7,6 +7,7 @@ namespace Devlooped.Sponsors; +[Description("Checks the validity of a GitHub token.")] public class CheckTokenCommand(IGraphQueryClient graph, ICommandApp app, Config config) : GitHubAsyncCommand(app, config) { public class CheckSettings : ToSSettings