From e7eef61f027f749a7e5e9d5bebfa3f2f2292683d Mon Sep 17 00:00:00 2001 From: Alex Davies Date: Thu, 19 Sep 2024 21:54:50 +1200 Subject: [PATCH] Add github workfows * Add yaml for release builds * Add yaml for test builds --- .github/workflows/release.yaml | 22 ++++++++++++ .github/workflows/test.yaml | 36 +++++++++++++++++++ appveyor.yml | 34 ------------------ .../StringToExpression.csproj | 34 +++++++++--------- 4 files changed, 76 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/test.yaml delete mode 100644 appveyor.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..9182ab9 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,22 @@ +name: release +on: + push: + tags: + - 'v*' +jobs: + release: + + runs-on: ubuntu-latest + + steps: + - name: Set RELEASE_VERSION + run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV #GITHUB_REF:11 skips first 11 characters of GITHUB_REF (GITHUB_REF will look like 'refs/tags/v*.*.*') + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.* + - name: Pack + run: dotnet pack --output ./artifacts --configuration Release -p:GeneratePackageOnBuild=false -p:ContinuousIntegrationBuild=true -p:Version=$RELEASE_VERSION + - name: Publish packages + run: dotnet nuget push ./artifacts/**.nupkg --source nuget.org --api-key ${{secrets.NUGET_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..72d25c1 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,36 @@ +name: test + +on: + pull_request: + branches: [master] + types: [synchronize, opened, reopened, ready_for_review, unlabeled] + paths-ignore: + - 'README.md' + push: + branches: [master] + paths-ignore: + - 'README.md' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.* + - name: Install dotnet-validate + run: dotnet tool install --global dotnet-validate --version 0.0.1-preview.304 + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build -p:ContinuousIntegrationBuild=true --configuration Release --no-restore + - name: Test + run: dotnet test --configuration Release --no-build --verbosity normal + - name: Pack + run: dotnet pack --output ./artifacts --no-build + - name: Validate NuGet package + run: dotnet-validate package local artifacts/*.nupkg \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 8adf1d7..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: build.{build} -skip_tags: true -image: Visual Studio 2022 -configuration: Release -before_build: -- ps: >- - nuget restore - - - [xml]$proj = Get-Content src/StringToExpression/StringToExpression.csproj - - $semver = $proj.Project.PropertyGroup.Version - - Set-AppveyorBuildVariable "semver" $semver - - Update-AppveyorBuild -Version "$semver-build.${env:APPVEYOR_BUILD_NUMBER}" -build: - verbosity: minimal -artifacts: -- path: src\StringToExpression\bin\Release\StringToExpression.*.*.*.nupkg - name: nupkg -deploy: -- provider: NuGet - api_key: - secure: NTqy7aQ741jkqBIbCZYWh9r6hRV0JbDw9xzDukvhcW7f4WEuWFEOK4S7scwElnI4 - on: - branch: master -- provider: GitHub - release: v$(semver) - auth_token: - secure: EllB83LHfhXsxb7aQ4/+tPPwF7GelAfEr27vj4BsNr5fU0RDC7zEYM5Aeihnn0SZ - artifact: nupkg - on: - branch: master diff --git a/src/StringToExpression/StringToExpression.csproj b/src/StringToExpression/StringToExpression.csproj index a2adaea..04e7027 100644 --- a/src/StringToExpression/StringToExpression.csproj +++ b/src/StringToExpression/StringToExpression.csproj @@ -1,19 +1,21 @@  + + netstandard2.0 + 7.3 + True + Codecutout + Alex Davies + StringToExpression supports the compiling a domain specific string into a .NET expression. - - netstandard2.0 - Codecutout - Alex Davies - StringToExpression supports the compiling a domain specific string into a .NET expression. - -Out of the box configuration is provided for parsing arithmetic expressions and for parsing OData filter strings. Although can be configured to parse string of any format - Copyright © 2017 - https://github.com/codecutout/StringToExpression/blob/master/LICENSE - https://github.com/codecutout/StringToExpression - Expression Filter OData Arithmetic DSL - True - 2.1.1 - Add checks to prevent keywords from being identified within property names. - - + Out of the box configuration is provided for parsing arithmetic expressions and for parsing OData filter strings. Although can be configured to parse string of any format + MIT + https://github.com/codecutout/StringToExpression + Expression Filter OData Arithmetic DSL + true + true + snupkg + + + +