diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..749f5e2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: RGB.NET-CI + +on: + push: + branches: [ Development ] + paths: + - '**.cs' + - '**.csproj' + - '**.yml' + +jobs: + build: + + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Git Semantic Version + id: versioning + uses: PaulHatch/semantic-version@v4.0.3 + with: + short_tags: false + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs.version }} + - name: Test + run: dotnet test --no-build --verbosity normal --configuration Release + - name: Upload a Build Artifact NET5 + uses: actions/upload-artifact@v2.2.4 + with: + name: RGB.NET-NET5 + path: bin/net5.0/RGB.NET.*.dll + if-no-files-found: error + - name: Upload a Build Artifact NET6 + uses: actions/upload-artifact@v2.2.4 + with: + name: RGB.NET-NET6 + path: bin/net6.0/RGB.NET.*.dll + if-no-files-found: error + - name: Upload Nuget Build Artifact + uses: actions/upload-artifact@v2.2.4 + with: + name: RGB.NET-Nugets + path: bin/*nupkg + if-no-files-found: error + - name: Nuget Push + run: dotnet nuget push "bin/*.nupkg" --skip-duplicate --api-key ${NUGET_TOKEN} + env: + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} + - name: Nuget Push Symbols + run: dotnet nuget push "bin/*.snupkg" --skip-duplicate --api-key ${NUGET_TOKEN} + env: + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} diff --git a/.github/workflows/pr_verify.yml b/.github/workflows/pr_verify.yml new file mode 100644 index 0000000..c04f21d --- /dev/null +++ b/.github/workflows/pr_verify.yml @@ -0,0 +1,24 @@ +name: PR-Verify + +on: + pull_request: + branches: [ master, Development ] + +jobs: + build: + + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore --configuration Release /p:Version=0.0.0 + - name: Test + run: dotnet test --no-build --verbosity normal --configuration Release + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f1bd3e3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: RGB.NET-Release + +on: + push: + branches: [ master ] + paths: + - '**.cs' + - '**.csproj' + - '**.yml' + +jobs: + build: + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Git Semantic Version + id: versioning + uses: PaulHatch/semantic-version@v4.0.3 + with: + short_tags: false + format: "${major}.${minor}.${patch}" + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs.version }} + - name: Test + run: dotnet test --no-build --verbosity normal --configuration Release + - name: Upload a Build Artifact NET5 + uses: actions/upload-artifact@v2.2.4 + with: + name: RGB.NET-NET5 + path: bin/net5.0/RGB.NET.*.dll + if-no-files-found: error + - name: Upload a Build Artifact NET6 + uses: actions/upload-artifact@v2.2.4 + with: + name: RGB.NET-NET6 + path: bin/net6.0/RGB.NET.*.dll + if-no-files-found: error + - name: Upload Nuget Build Artifact + uses: actions/upload-artifact@v2.2.4 + with: + name: RGB.NET-Nugets + path: bin/*nupkg + if-no-files-found: error + - name: Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.versioning.outputs.version_tag }} + generate_release_notes: true + files: bin/net6.0/RGB.NET.*.dll + - name: Nuget Push + run: dotnet nuget push "bin/*.nupkg" --skip-duplicate --api-key ${NUGET_TOKEN} + env: + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} + - name: Nuget Push Symbols + run: dotnet nuget push "bin/*.snupkg" --skip-duplicate --api-key ${NUGET_TOKEN} + env: + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}