patternfly-yew 0.7.4

PatternFly 5 components for Yew
Documentation
name: release

on:
  push:
    # Releases are tags named 'v<version>', and must have the "major.minor.micro", for example: "0.1.0".
    # Release candidates are tagged as `v<version>-rc<num>`, for example: "0.1.0-rc1".
    tags:
      - "v*"

permissions:
  contents: write # for creating a release

jobs:

  init:
    runs-on: ubuntu-slim
    outputs:
      version: ${{steps.version.outputs.version}}
      prerelease: ${{steps.state.outputs.prerelease}}
    steps:
      - name: Evaluate state
        id: state
        env:
          HEAD_REF: ${{github.head_ref}}
        run: |
          test -z "${HEAD_REF}" && (echo 'do-publish=true' >> $GITHUB_OUTPUT)
          if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
              echo release=true >> $GITHUB_OUTPUT
          elif [[ "${{ github.event.ref }}" =~ ^refs/tags/v.*$ ]]; then
              echo prerelease=true >> $GITHUB_OUTPUT
          fi
      - name: Set version
        id: version
        run: |
          VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
          [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
          [ "$VERSION" == "main" ] && VERSION=latest
          echo "Version: $VERSION"
          echo "version=$VERSION" >> $GITHUB_OUTPUT


  # check that our CI would pass
  ci:
    uses: ./.github/workflows/ci.yaml

  # publish directly after CI check
  publish:
    needs: [ init, ci ]
    runs-on: ubuntu-24.04
    steps:

      - name: Checkout
        uses: actions/checkout@v6

      - name: Install convco
        run: |
          curl -sLO https://github.com/convco/convco/releases/download/v0.6.3/convco-ubuntu.zip
          unzip convco-ubuntu.zip
          sudo install convco /usr/local/bin

      - name: Generate changelog
        run: |
          convco changelog -s --max-majors=1 --max-minors=1 --max-patches=1 -n > /tmp/changelog.md

      - name: Create Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TAG: v${{ needs.init.outputs.version }}
        run: |
          OPTS=""

          if [[ "${{ needs.init.outputs.prerelease }}" == "true" ]]; then
            OPTS="${OPTS} -p"
          fi

          gh release create ${OPTS} --title "${{ needs.init.outputs.version }}" -F /tmp/changelog.md ${TAG}