Skip to content

Use the right env path for GitVersion #71

Use the right env path for GitVersion

Use the right env path for GitVersion #71

Workflow file for this run

name: dotnet
on:
push:
branches: [ main ]
tags: ["*"]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
- id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- run: |

Check failure on line 34 in .github/workflows/dotnet.yml

View workflow run for this annotation

GitHub Actions / dotnet

Invalid workflow file

The workflow is not valid. .github/workflows/dotnet.yml (Line: 34, Col: 14): Unexpected symbol: 'env:GitVersion_FullSemVer'. Located at position 1 within expression: env:GitVersion_FullSemVer
dotnet pack \
--include-source \
--include-symbols \
--configuration Release \
--no-build \
--no-restore \
-p:PackageVersion="${{ env:GitVersion_FullSemVer }}" \
RegExtract/RegExtract.csproj \
--output ${{ github.workspace }}/nugets/
- uses: actions/upload-artifact@v2
with:
name: nugets
path: nugets
nuget-push-dev:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: build
steps:
- name: download artifact
uses: actions/download-artifact@v2
with:
name: nugets
- name: setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
source-url: https://nuget.pkg.github.com/sblom/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: nuget push
run: dotnet nuget push *.nupkg *.snupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }}
nuget-push-prod:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build
steps:
- uses: actions/download-artifact@v2
with:
name: nugets
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
- run: dotnet nuget push *.nupkg *.snupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}