release #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow that is manually triggered | |
name: release | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "version" | |
required: true | |
default: "0" | |
jobs: | |
build_release: | |
name: create release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore ./src | |
- name: Build | |
run: dotnet publish ./src -c Release --no-restore -o ./release | |
- name: Test | |
run: dotnet test ./src -c Release --no-build --verbosity normal | |
- name: Zip | |
run: zip -qr Hangfire.Mongo-${{ github.event.inputs.version }}.zip ./release | |
- name: Create a Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: Release ${{ github.event.inputs.version }} | |
tag_name: ${{ github.event.inputs.version }} | |
draft: false | |
prerelease: false | |
files: Hangfire.Mongo-${{ github.event.inputs.version }}.zip | |
- name: Publish to nuget.org | |
run: dotnet nuget push src/Hangfire.Mongo/bin/Release/Hangfire.Mongo.*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json |