{"id":17255586,"url":"https://github.com/ffmathy/fluffyspoon.publishers","last_synced_at":"2025-08-21T00:32:29.785Z","repository":{"id":48689453,"uuid":"90338775","full_name":"ffMathy/FluffySpoon.Publishers","owner":"ffMathy","description":"Publishes NPM or NuGet packages automatically.","archived":false,"fork":false,"pushed_at":"2024-01-13T22:50:45.000Z","size":176,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-22T14:02:03.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ffMathy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-05T05:06:00.000Z","updated_at":"2022-03-11T23:23:00.000Z","dependencies_parsed_at":"2023-01-24T08:30:17.182Z","dependency_job_id":"bfceb330-0a21-4c0d-9776-310ce6121cfc","html_url":"https://github.com/ffMathy/FluffySpoon.Publishers","commit_stats":{"total_commits":153,"total_committers":5,"mean_commits":30.6,"dds":0.07189542483660127,"last_synced_commit":"e6438401316ea0cb834d89ffbd7f5e68f0b2d890"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffMathy%2FFluffySpoon.Publishers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffMathy%2FFluffySpoon.Publishers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffMathy%2FFluffySpoon.Publishers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffMathy%2FFluffySpoon.Publishers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ffMathy","download_url":"https://codeload.github.com/ffMathy/FluffySpoon.Publishers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230472888,"owners_count":18231511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T07:12:06.937Z","updated_at":"2024-12-19T17:25:38.231Z","avatar_url":"https://github.com/ffMathy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FluffySpoon.Publishers\nPublishes NuGet and NPM packages to the respective repositories.\n\n## Usage\nYou can also see a command-line runnable version of the following example [here](https://github.com/ffMathy/FluffySpoon.Publishers/blob/master/src/FluffySpoon.Publisher.Sample/Program.cs).\n\nThe code below will:\n- Find all repositories in https://github.com/ffMathy that start with `FluffySpoon.` and have been modified within the past 30 days.\n- For each repository, sorted by update date descending:\n    - Determine the version of the package. The version used will be `1.0.\u003cnumber of commits in repository\u003e`.\n    - For each C# project found in the `src` folder of the root of the repository:\n\t\t- Build `src/\u003cProjectName\u003e` using `dotnet build`.\n\t\t- Test `src/\u003cProjectName\u003e.Tests` if present using `dotnet test`.\n\t\t- Publish to NuGet if tests pass or no tests were present.\n    - For each NodeJS project found in the `src` folder of the root of the repository:\n\t\t- Build the root directory using `npm run build`.\n\t\t- Test the root directory using `npm run test`.\n\t\t- Publish to NPM.\n- For each C# project, publish it to NuGet.\n- For each NodeJS project, publish it to NPM.\n\n```csharp\nclass Program\n{\n    static void Main()\n    {\n        var services = new ServiceCollection();\n\n        //configure the publisher to take all GitHub repositories starting with \"FluffySpoon.\"\n        services.AddRepositoryToPackagePublisher(\"FluffySpoon.\");\n\n        //configure the publisher to use specific credentials for GitHub\n        services.AddGitHubProviderForAccessToken(\"ffMathy\", \"my GitHub access token\");\n\n        //configure NuGet publishing\n        services.AddNuGetProvider(\"my NuGet API key\");\n\n        //configure NPM publishing\n        services.AddNpmProvider(\"my NPM key\");\n\n        //configure .NET Core project support\n        services.AddDotNetProvider();\n\n        //configure NodeJS project support\n        services.AddNodeJsProvider();\n\n        var provider = services.BuildServiceProvider();\n\n        var publisher = provider.GetRequiredService\u003cIRepositoryToPackagePublisher\u003e();\n        publisher.RefreshAllPackagesFromAllRepositoriesAsync().Wait();\n\n        Console.WriteLine(\"All done!\");\n    }\n}\n```\n\n## Running in GitHub Actions\nBelow is an example of running the [sample code](https://github.com/ffMathy/FluffySpoon.Publishers/blob/master/src/FluffySpoon.Publisher.Sample/Program.cs) on an GitHub Actions using environment variables.\n\n### dotnet.yml\n```yml\nname: .NET\n\non:\n  push:\n  schedule:\n    - cron: '0 * * * *'\n    \njobs:\n  build:\n\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2\n    \n    - name: Setup .NET\n      uses: actions/setup-dotnet@v1\n      with:\n        dotnet-version: 6.0.x\n        \n    - name: Build\n      env:\n        ProjectNamePrefix: FluffySpoon.\n        GitHubUsername: ffMathy\n        NuGetKey: ${{ secrets.NuGetKey }}\n        NpmAuthToken: ${{ secrets.NpmAuthToken }}\n        GitHubPersonalAccessToken: ${{ secrets.GitHubPersonalAccessToken }}\n      run: |\n        cd src\n        dotnet restore\n        dotnet build\n        cd FluffySpoon.Publisher.Sample\n        dotnet run\n```\n\n## Running in AppVeyor\nBelow is an example of running the [sample code](https://github.com/ffMathy/FluffySpoon.Publishers/blob/master/src/FluffySpoon.Publisher.Sample/Program.cs) on an AppVeyor build server using environment variables.\n\n### AppVeyor.yml\n```yml\nversion: 1.0.{build}\nimage: Visual Studio 2017\nenvironment:\n  NuGetKey:\n    secure: 14GsJ75nn9jwVPMQXN7qN8xrwhyAY8TwIvvsQ+P1yzahdtfl83J8cyN+aA9WhtSY\n  ProjectNamePrefix: FluffySpoon.\n  GitHubUsername: ffMathy\n  NpmAuthToken:\n    secure: dg3EnwKFzX5E40SPkoPK53pW2D2W5sjCGV4xhORTCoe50OEASg8Xk9mI12SBVadI\n  GitHubPersonalAccessToken:\n    secure: ECBBXkriJnyuksnl3PYf7PQ/WLyRZLXf9qgLyIlOIeh4e8EnYCX5gkgmyyO1/HR+\ninstall:\n- ps: |\n    Install-Product node '' x64\n    npm install typescript -g\nbuild_script:\n- cmd: |\n    cd src\n    dotnet restore\n    dotnet build\n    cd FluffySpoon.Publisher.Sample\n    dotnet run\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffmathy%2Ffluffyspoon.publishers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fffmathy%2Ffluffyspoon.publishers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffmathy%2Ffluffyspoon.publishers/lists"}