Skip to content

upgrade to net9.0

upgrade to net9.0 #12

Workflow file for this run

name: release
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: NuGet/setup-nuget@v1
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: read project
id: readProject
uses: juliangruber/read-file-action@v1
with:
path: ./src/Serilog.Sinks.Aliyun/Serilog.Sinks.Aliyun.csproj
- name: get version
id: getVersion
uses: AsasInnab/regex-action@v1
with:
regex_pattern: '(?<=>)[^<>]+(?=</Version>)'
regex_flags: 'gim'
search_string: '${{ steps.readProject.outputs.content }}'
- name: dotnet restore
run: dotnet restore -s "https://api.nuget.org/v3/index.json"
- name: dotnet build
run: dotnet build -c Release
- name: dotnet test
run: dotnet test -c Release --no-restore --no-build
- name: dotnet pack
run: dotnet pack -c Release --no-build --property PackageOutputPath=${{ github.workspace }}/nugetPackages/
- name: dotnet nuget push to GitHub
uses: tanaka-takayoshi/[email protected]
with:
nupkg-path: '${{ github.workspace }}/nugetPackages/*.nupkg'
repo-owner: 'RayMMond'
gh-user: 'RayMMond'
token: ${{ secrets.GITHUB_TOKEN }}
- name: dotnet nuget push to NuGet
run: dotnet nuget push ${{ github.workspace }}/nugetPackages/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: determine if the tag exists
uses: mukunku/[email protected]
id: checkTag
with:
tag: ${{ steps.getVersion.outputs.first_match }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: add git tag
if: ${{ steps.checkTag.outputs.exists == 'false' }}
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.getVersion.outputs.first_match }}