name: Make a Github release

on:
  push:
    tags:
      - "v*"

permissions:
  contents: read

jobs:
  release:
    if: github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable'
    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
      - name: Release
        uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
        with:
          prerelease: ${{ contains(github.ref_name, '-rc') }}
          draft: ${{ github.repository == 'systemd/systemd' }}
