Skip to content

feat: Create GitHub actions build.yml #1

feat: Create GitHub actions build.yml

feat: Create GitHub actions build.yml #1

Workflow file for this run

name: Build
on:
push:
branches:
- main
paths-ignore:
- example/**
- tests/**
- LICENSE.md
- README.md
pull_request:
branches:
- main
paths-ignore:
- example/**
- tests/**
- LICENSE.md
- README.md
jobs:
build:
name: Build
runs-on: windows-2022
env:
CREATE_RELEASE: ${{ github.ref_name == 'main') && !contains(github.event.head_commit.message, 'dependabot[bot]') }}

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

View workflow run for this annotation

GitHub Actions / Build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 24, Col: 23): Unexpected symbol: ')'. Located at position 26 within expression: github.ref_name == 'main') && !contains(github.event.head_commit.message, 'dependabot[bot]') .github/workflows/build.yml (Line: 25, Col: 26): Unexpected symbol: ')'. Located at position 26 within expression: github.ref_name != 'main')
CREATE_PRERELEASE: ${{ github.ref_name != 'main') }}
steps:
- name: checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- uses: actions/[email protected]
name: Install .NET 8
with:
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: Restore .NET tools
run: dotnet tool restore
- name: Build
run: |
dotnet cake build.cake --bootstrap
dotnet cake build.cake --pack
- name: Upload NuGet Package
uses: actions/[email protected]
with:
name: package
path: .\artifacts\packages
- name: Push NuGet package on main branch
if: ${{ env.CREATE_RELEASE == 'true' }}
run: dotnet nuget push .\artifacts\packages\ --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ACTIONS }}
- name: Push NuGet package on feature branch
if: ${{ env.CREATE_PRERELEASE == 'true' }}
run: dotnet nuget push .\artifacts\packages\ --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ACTIONS }}