diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bad70b4..621fba9 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -5,7 +5,7 @@ name: .NET on: push: - branches: [ "main", "release/*" ] + branches: [ "main", "release/*", "feature/*" "bugfix/*"] pull_request: branches: [ "main" ] @@ -24,8 +24,17 @@ jobs: dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore + - name: Extract branch name if release + if: startsWith(github.ref, 'refs/heads/release') + shell: bash + run: echo "BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/release/}}" >> $GITHUB_ENV + - name: Extract branch name if not release + if: !startsWith(github.ref, 'refs/heads/release') + shell: bash + run: echo "BRANCH=0.0.1" >> $GITHUB_ENV + id: extract_branch_version - name: Build - run: dotnet build --no-restore + run: dotnet build --no-restore -c Release /property:Version=${{ env.BRANCH }} - name: Test run: dotnet test --no-build --verbosity normal --filter "TestCategory!=Integration" - name: Publish