86 lines
2.5 KiB
YAML
86 lines
2.5 KiB
YAML
# Use this workflow to trigger stable releases, both minor releases and patches
|
|
|
|
name: Stable release
|
|
|
|
run-name: "Stable release '${{ inputs.branch }}' (publish: ${{ inputs.publish }}, latest: ${{ inputs.branch == 'releases/beta' || inputs.latest }}, HTTP compression: ${{ inputs.http-compression }}, ML: ${{ inputs.ml }})"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
branch:
|
|
required: true
|
|
type: string
|
|
description: "The github branch of this release. Should be 'releases/beta' or 'patches/x.y'"
|
|
default: releases/beta
|
|
latest:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
description: "Consider this release as the latest one and update the Docker image tag and the binary pointer for the installers"
|
|
publish:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
description: "Publish the release"
|
|
http-compression:
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
description: "Enable HTTP compression in binaries"
|
|
ml:
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
description: "Enable ML support in binaries"
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
checks:
|
|
name: Pre-release checks
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Verify that the provided branch is either a release branch or a patch branch
|
|
run: |
|
|
set -x
|
|
if [[ "${{ inputs.branch }}" == "releases/beta" || "${{ inputs.branch }}" == "patches/"* ]]; then
|
|
exit 0
|
|
else
|
|
echo "Branch should either be 'releases/beta' or 'patches/x.y'"
|
|
exit 1
|
|
fi
|
|
|
|
release:
|
|
name: Prepare release
|
|
needs: [checks]
|
|
uses: ./.github/workflows/reusable_publish_version.yml
|
|
with:
|
|
environment: stable
|
|
git-ref: ${{ inputs.branch }}
|
|
latest: ${{ inputs.branch == 'releases/beta' || inputs.latest }}
|
|
publish: ${{ inputs.publish }}
|
|
create-release: ${{ inputs.publish }}
|
|
http-compression: ${{ inputs.http-compression }}
|
|
ml: ${{ inputs.ml }}
|
|
secrets: inherit
|
|
|
|
delete-branches:
|
|
name: Bump main version
|
|
if: ${{ inputs.publish }}
|
|
needs: [release]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Delete the release branch
|
|
run: |
|
|
set -x
|
|
git push origin --delete ${{ inputs.branch }} || true
|
|
git push origin --delete releases/stable || true
|