diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5c9de0c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,74 @@ +name: Release + +on: + release: + types: [published] + +permissions: + contents: read + packages: write + +env: + DOTNET_VERSION: "10.0.x" + NODE_VERSION: "20" + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + + - name: Restore dependencies + run: dotnet restore + + - name: Build project + run: dotnet build --no-restore --configuration Release + + - name: Run unit tests + run: dotnet test --no-build --verbosity normal --configuration Release /p:CollectCoverage=true /p:Threshold=50 /p:ThresholdType=line /p:ThresholdStat=Average /p:CoverletOutput=./TestResults/ /p:ExcludeByAttribute="GeneratedCodeAttribute" + + publish-github-packages: + name: Publish to GitHub Packages + runs-on: ubuntu-latest + needs: test + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + source-url: https://nuget.pkg.github.com/bpsLogicBuilder/index.json + env: + NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Restore dependencies + run: dotnet restore + + - name: Build project + run: dotnet build --no-restore --configuration Release + + - name: Publish to GitHub Packages + run: | + dotnet pack --configuration Release --no-build -o ./nupkg + dotnet nuget push ./nupkg/*.nupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/LogicBuilder.ComponentModel.Design.Serialization.slnx b/LogicBuilder.ComponentModel.Design.Serialization.slnx index 3c5936a..c17b4f8 100644 --- a/LogicBuilder.ComponentModel.Design.Serialization.slnx +++ b/LogicBuilder.ComponentModel.Design.Serialization.slnx @@ -1,6 +1,7 @@ +