From 0a24bc3748796a525d81160d627138d1ff56d83e Mon Sep 17 00:00:00 2001 From: ali zaferany Date: Thu, 29 Dec 2022 00:00:12 +0330 Subject: [PATCH] ci: setup and automate semantic-release --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++++ .releaserc | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f04b053 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: [workflow_dispatch] + +jobs: + build-test-prep-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: | + 3.1.x + 5.0.x + 6.0.x + + env: + DOTNET_INSTALL_DIR: /usr/share/dotnet + - name: build and test + run: | + dotnet restore ./src/CSharp/EasyMicroservices.Serialization.sln + dotnet build ./src/CSharp/EasyMicroservices.Serialization.sln --no-restore + dotnet test ./src/CSharp/EasyMicroservices.Serialization.sln --no-build + - name: setup semantic-release + run: | + npm install -D semantic-release + npm install -D @semantic-release/git + npm install -D @semantic-release/changelog + npm install -D @semantic-release/exec + npm install -D semantic-release-dotnet + npm install -D conventional-changelog-conventionalcommits + - name: run semantic-release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..8f96547 --- /dev/null +++ b/.releaserc @@ -0,0 +1,40 @@ +{ + "branches": [ + "develop" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], + "@semantic-release/github", + "@semantic-release/changelog", + [ + "semantic-release-dotnet", + { + "paths": [ + "Directory.Build.props" + ], + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "Directory.Build.props", + "*.md", + "docs" + ], + "message": "chore: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +}