2023-12-05 11:52:09 +00:00
|
|
|
name: Tag release
|
|
|
|
|
|
|
|
run-name: "Tag release '${{ inputs.git-ref || github.ref_name }}' (publish: ${{ inputs.publish || github.event_name == 'push' }}, latest: ${{ inputs.latest || github.event_name == 'schedule' }})"
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
on:
|
2023-12-05 11:52:09 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
git-ref:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
description: "The github ref of this release. If you are publishing it, use a tag (i.e. v1.0.0)."
|
|
|
|
default: main
|
|
|
|
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"
|
2022-09-22 13:56:27 +00:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*.*.*"
|
|
|
|
|
2023-03-30 20:14:06 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2022-09-22 13:56:27 +00:00
|
|
|
jobs:
|
2023-12-05 11:52:09 +00:00
|
|
|
checks:
|
|
|
|
name: Pre-release checks
|
2023-08-04 15:39:50 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-12-05 11:52:09 +00:00
|
|
|
env:
|
|
|
|
GIT_REF: ${{ inputs.git-ref || github.ref_name }}
|
2022-09-22 13:56:27 +00:00
|
|
|
steps:
|
2023-12-05 11:52:09 +00:00
|
|
|
- name: Verify that the provided git_ref is a tag when 'publish' is true
|
|
|
|
if: ${{ inputs.publish || github.event_name == 'push' }}
|
|
|
|
run: |
|
|
|
|
git tag -l | grep -w $GIT_REF || (echo "The provided git_ref '$GIT_REF' is not a tag" && exit 1)
|
|
|
|
|
|
|
|
release:
|
|
|
|
name: Prepare release
|
|
|
|
needs: [checks]
|
|
|
|
uses: ./.github/workflows/reusable_publish_version.yml
|
|
|
|
with:
|
|
|
|
git-ref: ${{ inputs.git-ref || github.ref_name }}
|
|
|
|
latest: ${{ inputs.latest || github.event_name == 'push' }}
|
|
|
|
publish: ${{ inputs.publish || github.event_name == 'push' }}
|
|
|
|
create-release: ${{ inputs.publish || github.event_name == 'push' }}
|
|
|
|
secrets: inherit
|