Merge pull request #112 from Sharp0802/111 #149
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: .NET | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
working-directory: ./src/sika/ | |
- name: Build | |
run: dotnet build --no-restore | |
working-directory: ./src/sika/ | |
- name: Publish to NuGet | |
uses: brandedoutcast/publish-nuget@v2.5.2 | |
with: | |
PROJECT_FILE_PATH: "src/sika/sika.csproj" | |
VERSION_REGEX: '<AssemblyVersion>(.*)<\/AssemblyVersion>' | |
NUGET_KEY: ${{secrets.NUGET_KEY}} | |
if: github.event_name != 'pull_request' | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
version="$(grep '<AssemblyVersion>' src/sika/sika.csproj | grep -oE '([0-9]+\.){2}[0-9]+')" | |
gh release create "v$version" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--generate-notes | |
if: github.event_name != 'pull_request' |