From 414d078592d4630d986f96603a5efe6d1e8f602e Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Fri, 9 Feb 2024 00:01:39 +0100 Subject: [PATCH] CI: create the release workflow --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ Emulsion.sln | 1 + 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ca2db750 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release +on: + push: + branches: + - master + tags: + - 'v*' + pull_request: + branches: + - master + schedule: + - cron: '0 0 * * 6' # every Saturday + +jobs: + publish: + runs-on: ubuntu-22.04 + steps: + - name: Read version from Git ref + id: version + shell: pwsh + run: echo "version=$(if ($env:GITHUB_REF.StartsWith('refs/tags/v')) { $env:GITHUB_REF -replace '^refs/tags/v', '' } else { 'next' })" >> $env:GITHUB_OUTPUT + + - name: Checkout + uses: actions/checkout@v4 + + - name: Read the changelog + uses: ForNeVeR/ChangelogAutomation.action@v1 + with: + input: ./CHANGELOG.md + output: ./changelog-section.md + + - name: Upload the changelog + uses: actions/upload-artifact@v4 + with: + name: changelog-section.md + path: ./changelog-section.md + + - name: Create a release + if: startsWith(github.ref, 'refs/tags/v') + # noinspection SpellCheckingInspection + uses: softprops/action-gh-release@v1 + with: + name: Emulsion v${{ steps.version.outputs.version }} + body_path: ./changelog-section.md diff --git a/Emulsion.sln b/Emulsion.sln index 0608acac..a5d4abc1 100644 --- a/Emulsion.sln +++ b/Emulsion.sln @@ -26,6 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ ProjectSection(SolutionItems) = preProject .github\workflows\main.yml = .github\workflows\main.yml .github\workflows\docker.yml = .github\workflows\docker.yml + .github\workflows\release.yml = .github\workflows\release.yml EndProjectSection EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Emulsion.Database", "Emulsion.Database\Emulsion.Database.fsproj", "{0111F688-1AE2-4B5D-BF46-D60B64078788}"