Merge pull request #217 from tomchavakis/net8 #73
Workflow file for this run
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
name: release | |
on: | |
push: | |
tags: | |
- "v*" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet 8.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.x" # SDK Version to use (x uses the latest version). | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
# dotnet restore | |
- name: restore | |
run: dotnet restore | |
# dotnet build and publish | |
- name: Build with dotnet | |
run: dotnet build --configuration Release | |
# dotnet test | |
- name: test | |
run: dotnet test | |
# dotnet create package | |
- name: Create the package | |
run: dotnet pack --configuration Release | |
# publish the package | |
- name: Publish the artifact | |
run: dotnet publish -f net8.0 -c Release -o ./artifacts | |
# publish the package to package folder | |
- name: Publish the artifact | |
run: dotnet publish -f net8.0 -c Release -o ./package | |
# Add nuget package | |
- name: Nuget package | |
run: dotnet pack -c Release -o ./artifacts | |
# Zip Artifacts | |
- name: Zip artifacts | |
uses: tomchavakis/[email protected] | |
with: | |
args: zip -qq -r ./release.zip ./artifacts | |
- name: Create release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./release.zip | |
asset_name: release.zip | |
asset_content_type: application/zip | |
# Publish | |
- name: publish on version change | |
id: publish_nuget | |
uses: rohith/publish-nuget@v2 | |
with: | |
# Filepath of the project to be packaged, relative to root of repository | |
PROJECT_FILE_PATH: src/NugetUtility.csproj | |
# NuGet package id, used for version detection & defaults to project name | |
PACKAGE_NAME: dotnet-project-licenses | |
# Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH | |
# VERSION_FILE_PATH: Directory.Build.props | |
# Regex pattern to extract version info in a capturing group | |
VERSION_REGEX: <Version>(.*)<\/Version> | |
# Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX | |
# VERSION_STATIC: 1.0.0 | |
# Flag to toggle git tagging, enabled by default | |
# TAG_COMMIT: true | |
# Format of the git tag, [*] gets replaced with actual version | |
# TAG_FORMAT: v* | |
# API key to authenticate with NuGet server | |
NUGET_KEY: ${{secrets.NUGET_KEY}} | |
# NuGet server uri hosting the packages, defaults to https://api.nuget.org | |
NUGET_SOURCE: https://api.nuget.org | |
# Flag to toggle pushing symbo |