Skip to content

Commit

Permalink
CI: create the release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Feb 8, 2024
1 parent 3020209 commit 414d078
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions Emulsion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 414d078

Please sign in to comment.