diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bfe9d4b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: Build and Release + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + build: + 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 + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --no-build --verbosity normal + + - name: Create Release + if: github.ref == 'refs/heads/develop' && github.event_name == 'push' + uses: softprops/action-gh-release@v1 + with: + files: | + bin/Release/net6.0-windows/OBSLauncher.exe + bin/Release/net6.0-windows/OBSLauncher.dll + bin/Release/net6.0-windows/OBSLauncher.pdb + tag_name: v${{ github.run_number }} + name: Release v${{ github.run_number }} + body: | + Автоматически созданный релиз версии ${{ github.run_number }} + + ### Изменения + - Автоматическая сборка + - Тестирование + - Создание релиза + draft: false + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c497da0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,59 @@ +name: Build and Release + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + build: + 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 + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --no-build --verbosity normal + + - name: Create Release + if: github.ref == 'refs/heads/develop' && github.event_name == 'push' + uses: softprops/action-gh-release@v1 + with: + files: | + bin/Release/net6.0-windows/OBSLauncher.exe + bin/Release/net6.0-windows/OBSLauncher.dll + bin/Release/net6.0-windows/OBSLauncher.pdb + tag_name: v${{ github.run_number }} + name: Release v${{ github.run_number }} + body: | + Автоматически созданный релиз версии ${{ github.run_number }} + + ### Изменения + - Автоматическая сборка + - Тестирование + - Создание релиза + draft: false + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Program.cs b/Program.cs index 57102c1..4323184 100644 --- a/Program.cs +++ b/Program.cs @@ -186,4 +186,4 @@ namespace OBSLauncher delayTimer.Stop(); } } -} \ No newline at end of file +} \ No newline at end of file