quarkiverse / quarkiverse-devops

Scripts to maintain Quarkiverse repositories
3 stars 2 forks source link

New Release Workflow #275

Closed gastaldi closed 1 month ago

gastaldi commented 2 months ago

The release.yml workflows in each repository should be updated to the following content:

release-prepare.yaml

name: Quarkiverse Release

on:
  pull_request:
    types: [ closed ]
    paths:
      - '.github/project.yml'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  prepare-release:
    name: Prepare Release
    if: ${{ github.event.pull_request.merged == true}}
    uses: quarkiverse/.github/.github/workflows/prepare-release.yml@main
    secrets: inherit

release-perform.yaml

name: Quarkiverse Perform Release
run-name: Perform ${{github.event.inputs.tag || github.ref_name}} Release
on:
  push:
    tags:
      - '*'
  workflow_dispatch:
    inputs:
      tag:
        description: 'Tag to release'
        required: true

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  perform-release:
    name: Perform Release
    uses: quarkiverse/.github/.github/workflows/perform-release.yml@main
    secrets: inherit
    with:
      version: ${{github.event.inputs.tag || github.ref_name}}

pre-release.yaml

name: Quarkiverse Pre Release

on:
  pull_request:
    paths:
      - '.github/project.yml'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  pre-release:
    name: Pre-Release
    uses: quarkiverse/.github/.github/workflows/pre-release.yml@main
    secrets: inherit

This gives us the flexibility to adapt the release workflow as it's reusable by all Quarkiverse repositories, including, but not limited to, allowing the usage of protected branches during the release

ppalaga commented 2 months ago

I wonder if using mvn from the OS won't make the whole a bit undeterministic. Esp. note that moving to Maven 4 may happen soonish. I'd welcome some way to have Maven version explicit: either use mvnw or set the version as a param of the actions?

https://github.com/quarkiverse/.github/blob/main/.github/workflows/prepare-release.yml#L80

ppalaga commented 2 months ago

Otherwise nice, esp. the trick with having a special job for uploading to central, so that quarkiverse contributors cannot steal the credentials.

gastaldi commented 2 months ago

I wonder if using mvn from the OS won't make the whole a bit undeterministic. Esp. note that moving to Maven 4 may happen soonish. I'd welcome some way to have Maven version explicit: either use mvnw or set the version as a param of the actions?

quarkiverse/.github@main/.github/workflows/prepare-release.yml#L80

That makes sense, but most repositories do not have mvnw installed (it's not even included when I run quarkus create extension BTW). In the script I'll check if mvnw exists and use that instead (which I believe is better now).

In separate, we could also create PRs adding mvnw to them and include in the quarkus create extension generated files