Skip to content

Added Release-support #17

Added Release-support

Added Release-support #17

Workflow file for this run

name: Build and Test
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace }}/nuget
defaults:
run:
shell: sh
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore FactoryGenerator.sln
- name: Build
run: dotnet build FactoryGenerator.sln --no-restore
- name: Test
run: dotnet test FactoryGenerator.sln --no-build --no-restore
pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Pack Generator
run: dotnet pack FactoryGenerator/FactoryGenerator.csproj -o "${{ env.NuGetDirectory }}"
- name: Pack Attributes
run: dotnet pack FactoryGenerator.Attributes/FactoryGenerator.Attributes.csproj -o "${{ env.NuGetDirectory }}"
- uses: actions/upload-artifact@v4
with:
name: nuget-packages
if-no-files-found: error
retention-days: 1
path: ${{ env.NuGetDirectory }}/*.nupkg
deploy:
if: github.event_name = 'release'

Check failure on line 60 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Build and Test

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 60, Col: 9): Unexpected symbol: '='. Located at position 19 within expression: github.event_name = 'release'
runs-on: ubuntu-latest
needs: [ pack ]
steps:
- uses: actions/download-artifact@v4
with:
name: nuget-packages
path: ${{ env.NuGetDirectory }}
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
- name: Publish Nuget packages
run: |
for file in $(find "${{ env.NuGetDirectory }}" -type f -name "*.nupkg"); do
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
done