Fixing typo in deirectory #2
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: Nuget Package Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
PROJECT_NAME: MDD4All.SpecIF.DataProvider.WebAPI | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Read VERSION file | |
id: fileVersion | |
run: echo "FILE_VERSION_OUT=$(cat src/version.txt)" >> $GITHUB_OUTPUT | |
- name: Set version as environment variable | |
run: echo "VERSION=$(echo $FILE_VERSION.$GITHUB_RUN_NUMBER)" >> $GITHUB_ENV | |
env: | |
FILE_VERSION: ${{steps.fileVersion.outputs.FILE_VERSION_OUT}} | |
- name: Echo version number | |
run: echo $VERSION | |
- name: Restore dependencies | |
run: dotnet restore ./src/${PROJECT_NAME}/${PROJECT_NAME}.csproj | |
- name: Build | |
run: dotnet build --no-restore -c Release /p:Version=${VERSION} ./src/${PROJECT_NAME}/${PROJECT_NAME}.csproj | |
- name: Create nuget package(s) | |
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output ./Output ./src/${PROJECT_NAME}/${PROJECT_NAME}.csproj | |
- name: Upload artifact(s) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{env.PROJECT_NAME}}.${{env.VERSION}} | |
path: ./Output/*.nupkg |