gha-workflows/.github/workflows/create-release.yml

43 lines
1.3 KiB
YAML
Raw Normal View History

name: Create Release
on:
workflow_call:
2024-07-13 13:20:05 +02:00
outputs:
release_name:
description: "Name of the created release"
value: ${{ jobs.create_release.outputs.release_name }}
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
2024-07-13 13:20:05 +02:00
release_name: ${{ steps.tag_version.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Changes since last tag
id: changes
2024-07-15 21:55:57 +02:00
run: |
CHANGES=${git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline)
if [ -z "$CHANGES" ]; then exit 1; else exit 1; fi
- name: Bump version and push tag
if: steps.changes.outputs.any_changed == 'true'
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# default_bump: minor
default_bump: false
- name: Create a GitHub release
if: steps.changes.outputs.any_changed == 'true'
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
generateReleaseNotes: true