Skip to content

Commit

Permalink
build: add semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
PocketMiner82 committed Apr 2, 2024
1 parent 6b1a214 commit a47c05f
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
- name: setup-msbuild
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
100 changes: 100 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -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": "<version>.*</version>",
"to": "<version>${nextRelease.version.split('-')[0]}</version>",
"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
}
]
]
}

0 comments on commit a47c05f

Please sign in to comment.