-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
Github supports actions with cron jobs. If you add GeneratePackageOnBuild to the .csproj to build a .nupkg file automatically, it's easy to push it to the NuGet server this way:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>name: .NET Core Build
on:
push:
branches: [ "main" ]
schedule:
- cron: "30 23 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build library
run: dotnet build ./UAParser/UAParser.csproj --configuration Release
- name: Push Package to NuGet.org
run: dotnet nuget push **\*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicateThis is a sample .github\workflows\build.yml file's content with a cron job which executes every night and automatically builds the project, creates the nuget package and then sends it to the nuget server. The NUGET_API_KEY should be defined in the settings/secrets/actions section of this repository as a new Repository secret.
Metadata
Metadata
Assignees
Labels
No labels