Skip to content

Commit 6cf8ceb

Browse files
committed
2 parents fc5b988 + be3cf24 commit 6cf8ceb

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Release
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
env:
11+
NET_VERSION: 8.0.100
12+
NUGET_PATH: './**/IeuanWalker.Hangfire.RecurringJob.${{ github.event.release.tag_name }}.nupkg'
13+
PROJECT_PATH: 'Scr/IeuanWalker.Hangfire.RecurringJob.Generator/IeuanWalker.Hangfire.RecurringJob.Generator.csproj'
14+
15+
jobs:
16+
build:
17+
runs-on: windows-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Setup .NET ${{ env.NET_VERSION }}
21+
uses: actions/setup-dotnet@v2
22+
with:
23+
dotnet-version: ${{ env.NET_VERSION }}
24+
- name: Restore dependencies
25+
run: dotnet restore
26+
- name: Build
27+
run: dotnet build ${{ env.PROJECT_PATH }} -c Release /p:Version=${{ github.event.release.tag_name }} --no-restore
28+
- uses: actions/upload-artifact@v3
29+
with:
30+
name: NuGet
31+
path: ${{ env.NUGET_PATH }}
32+
- name: Setup NuGet
33+
uses: NuGet/setup-nuget@v1.1.1
34+
- name: Publish
35+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
# Hangfire.RecurringJob
1+
# Hangfire.RecurringJob [![Nuget](https://img.shields.io/nuget/v/IeuanWalker.Hangfire.RecurringJob)](https://www.nuget.org/packages/IeuanWalker.Hangfire.RecurringJob) [![Nuget](https://img.shields.io/nuget/dt/IeuanWalker.Hangfire.RecurringJob)](https://www.nuget.org/packages/IeuanWalker.Hangfire.RecurringJob)
2+
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
24
[![Build](https://github.com/IeuanWalker/Hangfire.RecurringJob/actions/workflows/build.yml/badge.svg)](https://github.com/IeuanWalker/Hangfire.RecurringJob/actions/workflows/build.yml)
35

4-
This is a package that automatically generates the hanfire recurring jobs `AddOrUpdate` code, using source generators.
6+
Automatically generates the recurring job registration code using source generators
57

68
## How to use it?
79
1. Install the [NuGet package](#) into your project.
810
```
911
Install-Package IeuanWalker.Hangfire.RecurringJob
1012
```
1113

12-
2. Add the `RecurringJob` attribute to a class, and create a `Execute()` method.
14+
2. Add the `RecurringJob` attribute to a class, and create an `Execute()` method.
1315
```csharp
1416
[RecurringJob]
1517
public class RecurringJob1
@@ -49,15 +51,15 @@ public class RecurringJob4
4951
}
5052
```
5153
3. Register the recurring jobs
52-
> Once a `RecurringJob` attribute has been added to a class in your project a exention method for `IApplicationBuilder` will automatically be created.
53-
> The extention method name convention is AddRecurringJobsFrom + your assebly name.
54+
> Once a `RecurringJob` attribute has been added to a class in your project an extension method for `IApplicationBuilder` will automatically be created.
55+
> The extension method name convention is AddRecurringJobsFrom + your assembly name.
5456
```csharp
5557
app.AddRecurringJobsFromExampleProject();
5658
```
5759

5860
## Example
5961
Here is an example of what it looks like in use -
60-
> Left is example code, right is the generated code
62+
> Left is the example code, and right is the generated code
6163
6264
![image](https://github.com/IeuanWalker/Hangfire.RecurringJob.Generator/assets/6544051/cef12771-5178-46cf-9264-dbb54654efc6)
6365

0 commit comments

Comments
 (0)