diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d025110..9744c40 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,19 +1,16 @@ -name: build app +name: Build app on: workflow_dispatch: push: - branches: [ main ] pull_request: - branches: [ main ] jobs: build: + name: Build app runs-on: windows-2019 steps: - uses: actions/checkout@v2 - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1 - name: Setup NuGet uses: NuGet/setup-nuget@v1.0.5 - name: setup-msbuild diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e4b5ad3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + workflow_dispatch: + push: + branches: + - main + - dev + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v4 + with: + semantic_version: 21 + tag_format: ${version} + branches: | + [ + 'main', + { + name: 'dev', + prerelease: true + } + ] + extra_plugins: | + @semantic-release/changelog + @semantic-release/git + semantic-release-replace-plugin + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..21f00b8 --- /dev/null +++ b/.releaserc @@ -0,0 +1,100 @@ +{ + "branches": [ + "main", + { + "name": "dev", + "prerelease": true + } + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "releaseRules": [ + { + "type": "build", + "scope": "Needs bump", + "release": "patch" + } + ] + } + ], + [ + "semantic-release-replace-plugin", + { + "replacements": [ + { + "files": [ + "SolutionInfo.cs" + ], + "from": "AssemblyVersion\\(\".*\"\\)", + "to": "AssemblyVersion(\"${nextRelease.version.split('-')[0]}\")", + "results": [ + { + "file": "SolutionInfo.cs", + "hasChanged": true, + "numMatches": 1, + "numReplacements": 1 + } + ], + "countMatches": true + }, + { + "files": [ + "AutoUpdater.xml" + ], + "from": ".*", + "to": "${nextRelease.version.split('-')[0]}", + "results": [ + { + "file": "AutoUpdater.xml", + "hasChanged": true, + "numMatches": 1, + "numReplacements": 1 + } + ], + "countMatches": true + } + ] + } + ], + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + + [ + "@semantic-release/git", + { + "assets": [ + "README.md", + "CHANGELOG.md", + "SolutionInfo.cs", + "AutoUpdater.xml" + ] + } + ], + [ + "@semantic-release/github", + { + "assets": [ + { + "path": "bin/Release/", + "name": "pseudocode-ide" + } + ], + "successComment": false + } + ], + [ + "@saithodev/semantic-release-backmerge", + { + "backmergeBranches": [ + { + "from": "main", + "to": "dev" + } + ], + "clearWorkspace": true + } + ] + ] +} \ No newline at end of file