ci: switch to git-cliff for changelog generation (#2802)
This commit is contained in:
@@ -1,136 +0,0 @@
|
||||
name: Compute Release Notes
|
||||
description: Build conventional-commit release notes for an explicit git range.
|
||||
|
||||
inputs:
|
||||
base_tag:
|
||||
description: Stable tag that anchors the preview version calculation
|
||||
required: false
|
||||
default: ''
|
||||
from_ref:
|
||||
description: Git ref that marks the start of the changelog range
|
||||
required: true
|
||||
repository_url:
|
||||
description: Repository URL used for compare and commit links
|
||||
required: false
|
||||
default: ''
|
||||
to_ref:
|
||||
description: Git ref that marks the end of the changelog range
|
||||
required: true
|
||||
|
||||
outputs:
|
||||
compare_url:
|
||||
description: Compare URL for the computed range
|
||||
value: ${{ steps.extract.outputs.compare_url }}
|
||||
details_url:
|
||||
description: Workflow run URL that contains the full markdown summary
|
||||
value: ${{ steps.extract.outputs.details_url }}
|
||||
predicted_version:
|
||||
description: Predicted semantic version for the supplied range
|
||||
value: ${{ steps.extract.outputs.predicted_version }}
|
||||
release_notes:
|
||||
description: Markdown notes generated from conventional commits
|
||||
value: ${{ steps.extract.outputs.release_notes }}
|
||||
release_type:
|
||||
description: Highest semantic release type found in the range
|
||||
value: ${{ steps.extract.outputs.release_type }}
|
||||
released:
|
||||
description: Whether the range contains any releasable commits
|
||||
value: ${{ steps.extract.outputs.released }}
|
||||
to_sha:
|
||||
description: Resolved ending SHA for the range
|
||||
value: ${{ steps.extract.outputs.to_sha }}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.to_ref }}
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@a1df9120380005ebdc788c62449b841b205541dd # v2.71.0
|
||||
with:
|
||||
tool: just
|
||||
|
||||
- name: Set Up pnpm
|
||||
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
|
||||
|
||||
- name: Set Up Node.js
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
|
||||
- name: Install Release Tooling Dependencies
|
||||
shell: bash
|
||||
run: just release install
|
||||
|
||||
- name: Generate Range Notes
|
||||
shell: bash
|
||||
env:
|
||||
BASE_TAG: ${{ inputs.base_tag }}
|
||||
FROM_REF: ${{ inputs.from_ref }}
|
||||
OUTPUT_JSON: range-release.json
|
||||
OUTPUT_NOTES: range-release-notes.md
|
||||
REPOSITORY_URL: ${{ inputs.repository_url != '' && inputs.repository_url || format('{0}/{1}', github.server_url, github.repository) }}
|
||||
TO_REF: ${{ inputs.to_ref }}
|
||||
run: |
|
||||
just release range-notes | tee tools/release/range-release.log
|
||||
|
||||
- name: Extract Range Outputs
|
||||
id: extract
|
||||
shell: bash
|
||||
env:
|
||||
BASE_TAG: ${{ inputs.base_tag }}
|
||||
DETAILS_URL: ${{ format('{0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id) }}
|
||||
FROM_REF: ${{ inputs.from_ref }}
|
||||
TO_REF: ${{ inputs.to_ref }}
|
||||
run: |
|
||||
set -eu
|
||||
|
||||
compare_url="$(jq -r '.compareUrl // empty' tools/release/range-release.json)"
|
||||
predicted_version="$(jq -r '.nextVersion // empty' tools/release/range-release.json)"
|
||||
release_type="$(jq -r '.releaseType // empty' tools/release/range-release.json)"
|
||||
released="$(jq -r '.released' tools/release/range-release.json)"
|
||||
to_sha="$(jq -r '.toSha // empty' tools/release/range-release.json)"
|
||||
release_notes_delim="EOF_$(openssl rand -hex 16)"
|
||||
|
||||
{
|
||||
echo "compare_url=${compare_url}"
|
||||
echo "details_url=${DETAILS_URL}"
|
||||
echo "predicted_version=${predicted_version}"
|
||||
echo "release_type=${release_type}"
|
||||
echo "released=${released}"
|
||||
echo "to_sha=${to_sha}"
|
||||
echo "release_notes<<${release_notes_delim}"
|
||||
cat tools/release/range-release-notes.md
|
||||
printf '\n'
|
||||
echo "${release_notes_delim}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
{
|
||||
echo "## Full Changelog"
|
||||
echo
|
||||
echo "- Range: \`${FROM_REF}..${TO_REF}\`"
|
||||
echo "- Predicted version: \`${predicted_version:-none}\`"
|
||||
echo "- Release type: \`${release_type:-none}\`"
|
||||
if [ -n "${BASE_TAG}" ]; then
|
||||
echo "- Base stable tag: \`${BASE_TAG}\`"
|
||||
fi
|
||||
if [ -n "$compare_url" ]; then
|
||||
echo "- Compare: ${compare_url}"
|
||||
fi
|
||||
echo
|
||||
cat tools/release/range-release-notes.md
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
- name: Upload Range Notes Artifact
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: range-release-notes
|
||||
path: |
|
||||
tools/release/range-release.json
|
||||
tools/release/range-release-notes.md
|
||||
tools/release/range-release.log
|
||||
retention-days: 14
|
||||
@@ -0,0 +1,137 @@
|
||||
# git-cliff ~ configuration file
|
||||
# https://git-cliff.org/docs/configuration
|
||||
|
||||
[bump]
|
||||
features_always_bump_minor = true
|
||||
breaking_always_bump_major = true
|
||||
|
||||
[changelog]
|
||||
# A Tera template to be rendered as the changelog's header.
|
||||
# See https://keats.github.io/tera/#getting-started
|
||||
header = """
|
||||
"""
|
||||
|
||||
# A Tera template to be rendered for each release in the changelog.
|
||||
# See https://keats.github.io/tera/#getting-started
|
||||
body = """
|
||||
{%- macro remote_url() -%}
|
||||
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
|
||||
{%- endmacro -%}
|
||||
|
||||
{% macro print_commit(commit) -%}
|
||||
- {% if commit.scope %}**{{ commit.scope }}:** {% endif %}\
|
||||
{% if commit.breaking %}[**breaking**] {% endif %}\
|
||||
{{ commit.message | upper_first }} \
|
||||
([`{{ commit.id | truncate(length=7, end="") }}`]({{ self::remote_url() }}/commit/{{ commit.id }}))\
|
||||
{% endmacro -%}
|
||||
|
||||
{% if version -%}
|
||||
{% if previous.version -%}
|
||||
## [{{ version | trim_start_matches(pat="v") }}]\
|
||||
({{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}) ({{ timestamp | date(format="%Y-%m-%d") }})
|
||||
{%- else -%}
|
||||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||
{%- endif %}
|
||||
{%- else -%}
|
||||
## [unreleased]
|
||||
{%- endif %}
|
||||
|
||||
## Changelog
|
||||
{% if version and previous.version %}
|
||||
**Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
|
||||
|
||||
{% endif -%}
|
||||
{% for group, commits in commits | group_by(attribute="group") %}
|
||||
### {{ group | striptags | trim | upper_first }}
|
||||
{% for commit in commits
|
||||
| filter(attribute="scope")
|
||||
| sort(attribute="scope") %}
|
||||
{{ self::print_commit(commit=commit) }}
|
||||
{%- endfor %}
|
||||
{% for commit in commits %}
|
||||
{%- if not commit.scope -%}
|
||||
{{ self::print_commit(commit=commit) }}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% endfor -%}
|
||||
{%- if version -%}
|
||||
{%- if github %}
|
||||
## Contributors
|
||||
|
||||
We'd like to thank the contributors for this release for taking the time to make Grimmory better.
|
||||
|
||||
Including but not limited to:
|
||||
{%- for contributor in github.contributors -%}
|
||||
{%- if contributor.username and contributor.username is not ending_with("[bot]") -%}
|
||||
{% raw %} {% endraw -%}@{{ contributor.username }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{% set first_time_contributors = github.contributors | filter(attribute="is_first_time", value=true) -%}
|
||||
{% if first_time_contributors | length != 0 %}
|
||||
|
||||
### New Contributors
|
||||
{% endif %}\
|
||||
{% for contributor in first_time_contributors %}
|
||||
* @{{ contributor.username }} made their first contribution
|
||||
{%- if contributor.pr_number %} in #{{ contributor.pr_number }}{%- endif %}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
"""
|
||||
# A Tera template to be rendered as the changelog's footer.
|
||||
# See https://keats.github.io/tera/#getting-started
|
||||
footer = """
|
||||
"""
|
||||
|
||||
# Remove leading and trailing whitespaces from the changelog's body.
|
||||
trim = true
|
||||
# Format the rendered changelog as Markdown (only applies to Markdown output).
|
||||
# format = true
|
||||
# An array of regex based postprocessors to modify the changelog.
|
||||
postprocessors = [
|
||||
|
||||
]
|
||||
|
||||
[git]
|
||||
# Parse commits according to the conventional commits specification.
|
||||
# See https://www.conventionalcommits.org
|
||||
conventional_commits = true
|
||||
# Exclude commits that do not match the conventional commits specification.
|
||||
filter_unconventional = true
|
||||
# Split commits on newlines, treating each line as an individual commit.
|
||||
split_commits = false
|
||||
# An array of regex based parsers to modify commit messages prior to further processing.
|
||||
commit_preprocessors = [
|
||||
|
||||
]
|
||||
# An array of regex based parsers for extracting data from the commit message.
|
||||
# Assigns commits to groups.
|
||||
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
|
||||
commit_parsers = [
|
||||
# Skip commits without a scope, except breaking changes (e.g., "feat!: xxx")
|
||||
{ message = "^feat", group = "<!-- 0 -->Features" },
|
||||
{ message = "^fix", group = "<!-- 1 -->Bug Fixes" },
|
||||
{ message = "^doc", group = "<!-- 3 -->Documentation" },
|
||||
{ message = "^perf", group = "<!-- 4 -->Performance" },
|
||||
{ message = "^refactor", group = "<!-- 2 -->Refactor" },
|
||||
{ message = "^style", group = "<!-- 5 -->Styling" },
|
||||
{ message = "^test", group = "<!-- 6 -->Testing" },
|
||||
{ message = "^chore\\(deps.*\\)", group = "<!-- 8 -->Dependencies" },
|
||||
{ message = "^chore|^ci", group = "<!-- 7 -->Miscellaneous Tasks" },
|
||||
{ message = "^revert", group = "<!-- 9 -->Revert" },
|
||||
]
|
||||
# Prevent commits that are breaking from being excluded by commit parsers.
|
||||
protect_breaking_commits = false
|
||||
# Exclude commits that are not matched by any commit parser.
|
||||
filter_commits = false
|
||||
# Regex to select git tags that represent releases.
|
||||
tag_pattern = "v[0-9].*"
|
||||
# Regex to select git tags that do not represent proper releases.
|
||||
# Takes precedence over `tag_pattern`.
|
||||
# Changes belonging to these releases will be included in the next release.
|
||||
skip_tags = "beta|alpha"
|
||||
# Order releases topologically instead of chronologically.
|
||||
topo_order = false
|
||||
# Order of commits in each group/release within the changelog.
|
||||
# Allowed values: newest, oldest
|
||||
sort_commits = "newest"
|
||||
@@ -0,0 +1,149 @@
|
||||
name: Compute Release Notes
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
bump:
|
||||
description: Whether to bump the version for the changelog generated
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
from-ref:
|
||||
description: Git ref that marks the start of the changelog range
|
||||
type: string
|
||||
required: true
|
||||
to-ref:
|
||||
description: Git ref that marks the end of the changelog range
|
||||
type: string
|
||||
required: true
|
||||
|
||||
outputs:
|
||||
compare-url:
|
||||
description: Compare URL for the computed range
|
||||
value: ${{ jobs.compute-release-notes.outputs.compare-url }}
|
||||
details-url:
|
||||
description: Workflow run URL that contains the full markdown summary
|
||||
value: ${{ jobs.compute-release-notes.outputs.details-url }}
|
||||
version:
|
||||
description: Predicted semantic version for the supplied range
|
||||
value: ${{ jobs.compute-release-notes.outputs.version }}
|
||||
release-notes:
|
||||
description: Markdown notes generated from conventional commits
|
||||
value: ${{ jobs.compute-release-notes.outputs.release-notes }}
|
||||
|
||||
jobs:
|
||||
compute-release-notes:
|
||||
name: Compute Release Notes
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
outputs:
|
||||
compare-url: ${{ steps.extract.outputs.compare-url }}
|
||||
details-url: ${{ steps.extract.outputs.details-url }}
|
||||
version: ${{ steps.git-cliff.outputs.version }}
|
||||
release-notes: ${{ steps.git-cliff.outputs.release-notes }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
ref: ${{ inputs.to-ref }}
|
||||
|
||||
- name: Install git-cliff
|
||||
uses: taiki-e/install-action@4cef1412cce204788f482e778a0b9187f9626a29 # v2.87.21
|
||||
with:
|
||||
tool: git-cliff
|
||||
|
||||
- name: Run git-cliff
|
||||
id: git-cliff
|
||||
shell: bash
|
||||
env:
|
||||
IS_BUMP: ${{ inputs.bump }}
|
||||
GIT_CLIFF_CONFIG: .github/cliff.toml
|
||||
FROM_REF: ${{ inputs.from-ref }}
|
||||
TO_REF: ${{ inputs.to-ref }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_REPO: ${{ github.repository }}
|
||||
run: |
|
||||
set -eu
|
||||
|
||||
git-cliff \
|
||||
--config ${GIT_CLIFF_CONFIG} \
|
||||
--context \
|
||||
--output range-context.json \
|
||||
"${FROM_REF}..${TO_REF}"
|
||||
|
||||
if [ "$IS_BUMP" = "true" ]; then
|
||||
BUMP_ARG="--bump"
|
||||
else
|
||||
BUMP_ARG=""
|
||||
fi
|
||||
|
||||
git-cliff \
|
||||
--config ${GIT_CLIFF_CONFIG} \
|
||||
--from-context range-context.json \
|
||||
${BUMP_ARG} \
|
||||
--output range-notes.md \
|
||||
"${FROM_REF}..${TO_REF}"
|
||||
|
||||
RELEASE_NOTES_DELIM="EOF_$(openssl rand -hex 16)"
|
||||
|
||||
{
|
||||
echo "release-notes<<${RELEASE_NOTES_DELIM}"
|
||||
cat range-notes.md
|
||||
printf '\n'
|
||||
echo "${RELEASE_NOTES_DELIM}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
PREDICTED_VERSION=$(
|
||||
git-cliff \
|
||||
--config ${GIT_CLIFF_CONFIG} \
|
||||
--from-context range-context.json \
|
||||
--bumped-version \
|
||||
"${FROM_REF}..${TO_REF}"
|
||||
)
|
||||
|
||||
echo "version=${PREDICTED_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Extract Range Outputs
|
||||
id: extract
|
||||
shell: bash
|
||||
env:
|
||||
FROM_REF: ${{ inputs.from-ref }}
|
||||
TO_REF: ${{ inputs.to-ref }}
|
||||
PREDICTED_VERSION: ${{ steps.git-cliff.outputs.version }}
|
||||
RELEASE_NOTES: ${{ steps.git-cliff.outputs.release-notes }}
|
||||
DETAILS_URL: ${{ format('{0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id) }}
|
||||
COMPARE_URL: ${{ format('{0}/{1}/compare/{2}...{3}', github.server_url, github.repository, inputs.from-ref, inputs.to-ref) }}
|
||||
run: |
|
||||
set -eu
|
||||
|
||||
{
|
||||
echo "compare-url=${COMPARE_URL}"
|
||||
echo "details-url=${DETAILS_URL}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
{
|
||||
echo "## Full Changelog"
|
||||
echo
|
||||
echo "- Range: \`${FROM_REF}..${TO_REF}\`"
|
||||
echo "- Predicted version: \`${PREDICTED_VERSION:-none}\`"
|
||||
if [ -n "$COMPARE_URL" ]; then
|
||||
echo "- Compare: ${COMPARE_URL}"
|
||||
fi
|
||||
echo
|
||||
echo "$RELEASE_NOTES"
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
- name: Upload Range Notes Artifact
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: range-release-notes
|
||||
path: |
|
||||
range-context.json
|
||||
range-notes.md
|
||||
retention-days: 14
|
||||
@@ -11,11 +11,6 @@ on:
|
||||
description: 'Resolved commit SHA for the candidate build'
|
||||
required: true
|
||||
type: string
|
||||
base_tag:
|
||||
description: 'Stable base tag that the candidate is built on top of'
|
||||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
mention_text:
|
||||
description: 'Optional role mentions or intro text to prepend to the message'
|
||||
required: false
|
||||
|
||||
@@ -9,7 +9,7 @@ on:
|
||||
description: 'Post the Discord nightly announcement'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
resolve_ref:
|
||||
@@ -20,7 +20,6 @@ jobs:
|
||||
contents: read
|
||||
|
||||
outputs:
|
||||
base_tag: ${{ steps.resolve.outputs.base_tag }}
|
||||
commit_sha: ${{ steps.resolve.outputs.commit_sha }}
|
||||
from_ref: ${{ steps.resolve.outputs.from_ref }}
|
||||
nightly_tag: ${{ steps.resolve.outputs.nightly_tag }}
|
||||
@@ -42,10 +41,8 @@ jobs:
|
||||
short_sha="$(git rev-parse --short HEAD)"
|
||||
build_date="$(date -u +%Y%m%d)"
|
||||
nightly_tag="nightly-${build_date}-${short_sha}"
|
||||
base_tag="$(git describe --tags --abbrev=0 --match 'v*' origin/main)"
|
||||
from_ref="$base_tag"
|
||||
from_ref="$(git describe --tags --abbrev=0 --match 'v*' origin/main)"
|
||||
|
||||
echo "base_tag=${base_tag}" >> "$GITHUB_OUTPUT"
|
||||
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
||||
echo "from_ref=${from_ref}" >> "$GITHUB_OUTPUT"
|
||||
echo "nightly_tag=${nightly_tag}" >> "$GITHUB_OUTPUT"
|
||||
@@ -160,54 +157,25 @@ jobs:
|
||||
retention-days: 30
|
||||
|
||||
generate-notes:
|
||||
name: Nightly Changelog
|
||||
if: ${{ always() && needs.test-suite.result == 'success' }}
|
||||
needs: [resolve_ref, test-suite]
|
||||
runs-on: ubuntu-latest
|
||||
name: Generate Notes
|
||||
needs:
|
||||
- resolve_ref
|
||||
uses: ./.github/workflows/compute-release-notes.yml
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
compare_url: ${{ steps.notes.outputs.compare_url }}
|
||||
details_url: ${{ steps.notes.outputs.details_url }}
|
||||
predicted_version: ${{ steps.notes.outputs.predicted_version }}
|
||||
release_notes: ${{ steps.notes.outputs.release_notes }}
|
||||
release_type: ${{ steps.notes.outputs.release_type }}
|
||||
released: ${{ steps.notes.outputs.released }}
|
||||
to_sha: ${{ steps.notes.outputs.to_sha }}
|
||||
available: ${{ steps.webhook_secrets_check.outputs.available }}
|
||||
steps:
|
||||
- name: Check Discord Webhook secrets
|
||||
id: webhook_secrets_check
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_NIGHTLY_WEBHOOK != '' && secrets.DISCORD_NIGHTLY_WEBHOOK || secrets.DISCORD_RELEASE_WEBHOOK }}
|
||||
run: |
|
||||
# Check here rather than in the `if`.
|
||||
# Github actions does not support the `secrets` context in `if` blocks.
|
||||
if [[ -n "${DISCORD_WEBHOOK}" ]]; then
|
||||
echo "available=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "available=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Checkout Workflow Repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Build Full Changelog
|
||||
if: ${{ steps.webhook_secrets_check.outputs.available == 'true' }}
|
||||
id: notes
|
||||
uses: ./.github/actions/compute-release-notes
|
||||
with:
|
||||
base_tag: ${{ needs.resolve_ref.outputs.base_tag }}
|
||||
from_ref: ${{ needs.resolve_ref.outputs.from_ref }}
|
||||
repository_url: ${{ format('{0}/{1}', github.server_url, github.repository) }}
|
||||
to_ref: ${{ needs.resolve_ref.outputs.commit_sha }}
|
||||
with:
|
||||
from-ref: ${{ needs.resolve_ref.outputs.from_ref }}
|
||||
to-ref: ${{ needs.resolve_ref.outputs.commit_sha }}
|
||||
secrets: inherit
|
||||
|
||||
notify-discord:
|
||||
name: Notify Discord (Nightly)
|
||||
if: ${{ always() && (github.event_name == 'schedule' || inputs.post_discord) && needs.generate-notes.result == 'success' && needs.build-and-push.result == 'success' && needs.export-openapi.result == 'success' && needs.generate-notes.outputs.available == 'true' && needs.generate-notes.outputs.predicted_version != '' }}
|
||||
needs: [resolve_ref, build-and-push, export-openapi, generate-notes]
|
||||
if: ${{ always() && (github.event_name == 'schedule' || inputs.post_discord) && needs.generate-notes.result == 'success' && needs.build-and-push.result == 'success' && needs.export-openapi.result == 'success' }}
|
||||
needs:
|
||||
- resolve_ref
|
||||
- build-and-push
|
||||
- export-openapi
|
||||
- generate-notes
|
||||
permissions: {}
|
||||
uses: ./.github/workflows/notify-discord-release-notes.yml
|
||||
secrets:
|
||||
@@ -215,12 +183,11 @@ jobs:
|
||||
with:
|
||||
channel: nightly
|
||||
candidate_sha: ${{ needs.resolve_ref.outputs.commit_sha }}
|
||||
base_tag: ${{ needs.resolve_ref.outputs.base_tag }}
|
||||
current_version: ${{ needs.resolve_ref.outputs.nightly_tag }}
|
||||
details_url: ${{ needs.generate-notes.outputs.details_url }}
|
||||
compare_url: ${{ needs.generate-notes.outputs.compare_url }}
|
||||
details_url: ${{ needs.generate-notes.outputs.details-url }}
|
||||
compare_url: ${{ needs.generate-notes.outputs.compare-url }}
|
||||
mention_text: ${{ vars.DISCORD_NIGHTLY_MENTIONS }}
|
||||
predicted_version: ${{ needs.generate-notes.outputs.predicted_version }}
|
||||
predicted_version: ${{ needs.generate-notes.outputs.version }}
|
||||
|
||||
test-suite:
|
||||
name: Test Suite
|
||||
|
||||
@@ -119,7 +119,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
base_tag: ${{ steps.metadata.outputs.base_tag }}
|
||||
compare_url: ${{ steps.metadata.outputs.compare_url }}
|
||||
available: ${{ steps.webhook_secrets_check.outputs.available }}
|
||||
|
||||
@@ -163,7 +162,6 @@ jobs:
|
||||
COMPARE_URL="https://github.com/${GITHUB_REPOSITORY}/compare/${BASE_TAG}...${RELEASE_TAG}"
|
||||
fi
|
||||
{
|
||||
echo "base_tag=${BASE_TAG}"
|
||||
echo "compare_url=${COMPARE_URL}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
@@ -183,6 +181,5 @@ jobs:
|
||||
predicted_version: ${{ github.event.release.tag_name }}
|
||||
details_url: ${{ github.event.release.html_url }}
|
||||
candidate_sha: ${{ github.sha }}
|
||||
base_tag: ${{ needs.prepare-release-notification.outputs.base_tag }}
|
||||
compare_url: ${{ needs.prepare-release-notification.outputs.compare_url }}
|
||||
mention_text: ${{ vars.DISCORD_STABLE_MENTIONS }}
|
||||
|
||||
@@ -66,33 +66,16 @@ jobs:
|
||||
echo "current_version=${current_version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
generate-notes:
|
||||
name: Release Candidate Changelog
|
||||
needs: [resolve_ref]
|
||||
runs-on: ubuntu-latest
|
||||
name: Generate Notes
|
||||
needs:
|
||||
- resolve_ref
|
||||
uses: ./.github/workflows/compute-release-notes.yml
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
compare_url: ${{ steps.notes.outputs.compare_url }}
|
||||
details_url: ${{ steps.notes.outputs.details_url }}
|
||||
predicted_version: ${{ steps.notes.outputs.predicted_version }}
|
||||
release_notes: ${{ steps.notes.outputs.release_notes }}
|
||||
release_type: ${{ steps.notes.outputs.release_type }}
|
||||
released: ${{ steps.notes.outputs.released }}
|
||||
to_sha: ${{ steps.notes.outputs.to_sha }}
|
||||
steps:
|
||||
- name: Checkout Workflow Repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Build Full Changelog
|
||||
id: notes
|
||||
uses: ./.github/actions/compute-release-notes
|
||||
with:
|
||||
base_tag: ${{ needs.resolve_ref.outputs.base_tag }}
|
||||
from_ref: ${{ needs.resolve_ref.outputs.base_tag }}
|
||||
repository_url: ${{ format('{0}/{1}', github.server_url, github.repository) }}
|
||||
to_ref: ${{ needs.resolve_ref.outputs.candidate_sha }}
|
||||
with:
|
||||
from-ref: ${{ needs.resolve_ref.outputs.base_tag }}
|
||||
to-ref: ${{ needs.resolve_ref.outputs.candidate_sha }}
|
||||
secrets: inherit
|
||||
|
||||
notify-discord:
|
||||
name: Notify Discord (RC)
|
||||
@@ -105,9 +88,8 @@ jobs:
|
||||
with:
|
||||
channel: rc
|
||||
candidate_sha: ${{ needs.resolve_ref.outputs.candidate_sha }}
|
||||
base_tag: ${{ needs.resolve_ref.outputs.base_tag }}
|
||||
current_version: ${{ needs.resolve_ref.outputs.current_version }}
|
||||
details_url: ${{ needs.generate-notes.outputs.details_url }}
|
||||
predicted_version: ${{ needs.generate-notes.outputs.predicted_version }}
|
||||
compare_url: ${{ needs.generate-notes.outputs.compare_url }}
|
||||
details_url: ${{ needs.generate-notes.outputs.details-url }}
|
||||
predicted_version: ${{ needs.generate-notes.outputs.version }}
|
||||
compare_url: ${{ needs.generate-notes.outputs.compare-url }}
|
||||
mention_text: ${{ vars.DISCORD_RC_MENTIONS }}
|
||||
|
||||
@@ -30,18 +30,16 @@ jobs:
|
||||
with:
|
||||
checkout_ref: ${{ github.sha }}
|
||||
|
||||
semantic-version:
|
||||
name: Compute Release and Changelog
|
||||
needs:
|
||||
- migration-check
|
||||
- test-suite
|
||||
resolve-refs:
|
||||
name: Resolve release ref
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
outputs:
|
||||
version: ${{ steps.notes.outputs.predicted_version }}
|
||||
commit-sha: ${{ steps.resolve.outputs.commit_sha }}
|
||||
from-ref: ${{ steps.resolve.outputs.from_ref }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
@@ -58,21 +56,24 @@ jobs:
|
||||
set -eu
|
||||
|
||||
git fetch origin main --tags --force
|
||||
base_tag="$(git describe --tags --abbrev=0 --match 'v*' origin/main)"
|
||||
from_ref="$base_tag"
|
||||
from_ref="$(git describe --tags --abbrev=0 --match 'v*' origin/main)"
|
||||
|
||||
echo "base_tag=${base_tag}" >> "$GITHUB_OUTPUT"
|
||||
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
||||
echo "from_ref=${from_ref}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build Changelog
|
||||
id: notes
|
||||
uses: ./.github/actions/compute-release-notes
|
||||
with:
|
||||
base_tag: ${{ steps.resolve.outputs.base_tag }}
|
||||
from_ref: ${{ steps.resolve.outputs.from_ref }}
|
||||
repository_url: ${{ format('{0}/{1}', github.server_url, github.repository) }}
|
||||
to_ref: ${{ steps.resolve.outputs.commit_sha }}
|
||||
semantic-version:
|
||||
name: Generate Notes
|
||||
needs:
|
||||
- resolve-refs
|
||||
- migration-check
|
||||
uses: ./.github/workflows/compute-release-notes.yml
|
||||
permissions:
|
||||
contents: read
|
||||
with:
|
||||
bump: true
|
||||
from-ref: ${{ needs.resolve-refs.outputs.from-ref }}
|
||||
to-ref: ${{ needs.resolve-refs.outputs.commit-sha }}
|
||||
secrets: inherit
|
||||
|
||||
build-frontend:
|
||||
name: Build frontend
|
||||
@@ -206,10 +207,6 @@ jobs:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: range-release-notes
|
||||
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: frontend
|
||||
@@ -239,14 +236,15 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN != '' && secrets.RELEASE_BOT_TOKEN || github.token }}
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN != '' && secrets.RELEASE_BOT_TOKEN || github.token }}
|
||||
RELEASE_NOTES: ${{ needs.semantic-version.outputs.release-notes }}
|
||||
RELEASE_VERSION: ${{ needs.semantic-version.outputs.version }}
|
||||
TARGET_REF: ${{ github.sha }}
|
||||
run: |
|
||||
gh release create \
|
||||
"v${RELEASE_VERSION}" \
|
||||
--title "Release v${RELEASE_VERSION}" \
|
||||
"${RELEASE_VERSION}" \
|
||||
--title "Release ${RELEASE_VERSION}" \
|
||||
--draft \
|
||||
--latest \
|
||||
--target "${TARGET_REF}" \
|
||||
--notes-file ./range-release-notes.md \
|
||||
--notes "${RELEASE_NOTES}" \
|
||||
release-assets/*
|
||||
|
||||
Reference in New Issue
Block a user