diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 0000000..2d2095b --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,39 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET Pre-Release + +on: + push: + branches: [ "main" ] + +jobs: + build: + permissions: + contents: write + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore StylableWinFormsControls/StylableWinFormsControls.sln + - name: Build + run: dotnet build StylableWinFormsControls/StylableWinFormsControls.sln --no-restore + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: "Development Build" + files: | + LICENSE + StylableWinFormsControls/StylableWinFormsControls/bin/Debug/net6.0-windows/StylableWinFormsControls.dll + StylableWinFormsControls/StylableWinFormsControls/bin/Debug/*.nupkg + StylableWinFormsControls/StylableWinFormsControls/bin/Debug/*.snupkg + + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..09ff0d6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET Release + +on: + push: + tags: + - "v*" + +jobs: + build: + permissions: + contents: write + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore StylableWinFormsControls/StylableWinFormsControls.sln + - name: Build + run: dotnet build StylableWinFormsControls/StylableWinFormsControls.sln -c Release --no-restore + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + LICENSE + StylableWinFormsControls/StylableWinFormsControls/bin/Release/net6.0-windows/StylableWinFormsControls.dll + StylableWinFormsControls/StylableWinFormsControls/bin/Release/*.nupkg + StylableWinFormsControls/StylableWinFormsControls/bin/Release/*.snupkg + - name: Pack nugets + run: dotnet pack StylableWinFormsControls/StylableWinFormsControls.sln -c Release --no-build --output . + - name: Push to NuGet + run: dotnet nuget push *.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json +