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-06 14:46:23 +00:00
|
|
|
outputs:
|
|
|
|
is-beta: ${{ steps.outputs.outputs.is-beta }}
|
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' }}
|
2023-12-06 14:46:23 +00:00
|
|
|
id: outputs
|
2023-12-05 11:52:09 +00:00
|
|
|
run: |
|
2023-12-06 14:46:23 +00:00
|
|
|
set -x
|
2023-12-05 11:52:09 +00:00
|
|
|
git tag -l | grep -w $GIT_REF || (echo "The provided git_ref '$GIT_REF' is not a tag" && exit 1)
|
2023-12-06 14:46:23 +00:00
|
|
|
if [[ $GIT_REF == *"-beta"* ]]; then
|
|
|
|
echo "is-beta=true" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
echo "is-beta=false" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
2023-12-05 11:52:09 +00:00
|
|
|
|
|
|
|
release:
|
|
|
|
name: Prepare release
|
|
|
|
needs: [checks]
|
|
|
|
uses: ./.github/workflows/reusable_publish_version.yml
|
|
|
|
with:
|
|
|
|
git-ref: ${{ inputs.git-ref || github.ref_name }}
|
2023-12-06 14:46:23 +00:00
|
|
|
latest: ${{ inputs.latest || (github.event_name == 'push' && needs.checks.outputs.is-beta == 'false') }}
|
2023-12-05 11:52:09 +00:00
|
|
|
publish: ${{ inputs.publish || github.event_name == 'push' }}
|
|
|
|
create-release: ${{ inputs.publish || github.event_name == 'push' }}
|
|
|
|
secrets: inherit
|