Files
wehub-resource-sync c56bef871b
Sync docs with Docusaurus / sync (push) Waiting to run
Tests / Check if changed (push) Waiting to run
Tests / format (push) Blocked by required conditions
Tests / check-imports (push) Blocked by required conditions
Tests / Unit / macos-latest (push) Blocked by required conditions
Tests / Unit / ubuntu-latest (push) Blocked by required conditions
Tests / Unit / windows-latest (push) Blocked by required conditions
Tests / mypy (push) Blocked by required conditions
Tests / Integration / ubuntu-latest (push) Blocked by required conditions
Tests / Integration / macos-latest (push) Blocked by required conditions
Tests / Integration / windows-latest (push) Blocked by required conditions
Tests / notify-slack-on-failure (push) Blocked by required conditions
Tests / Mark tests as completed (push) Blocked by required conditions
Docker image release / Build base image (push) Waiting to run
CodeQL / Analyze (python) (push) Has been cancelled
Update Platform Components Table / update (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:22:28 +08:00

105 lines
3.9 KiB
YAML

name: Project release on Github
on:
workflow_dispatch: # this is useful to re-generate the release page without a new tag being pushed
push:
tags:
- "v2.[0-9]+.[0-9]+*"
# Ignore release versions tagged with -rc0 suffix
- "!v2.[0-9]+.[0-9]-rc0"
permissions:
contents: read
jobs:
generate-notes:
runs-on: ubuntu-latest
permissions:
contents: write # ncipollo/release-action creates the GitHub release
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-tags: true
fetch-depth: 0 # slow but needed by reno
- name: Parse version
id: version
run: |
echo "current_release=$(awk -F \\- '{print $1}' < VERSION.txt)" >> "$GITHUB_OUTPUT"
echo "current_pre_release=$(awk -F \\- '{print $2}' < VERSION.txt)" >> "$GITHUB_OUTPUT"
- name: Install reno
run: |
python -m pip install --upgrade pip
pip install "reno<5" --uploaded-prior-to=P1D
# Remove next version rc0 tag in the CI environment to prevent reno from assigning notes to future releases.
# This ensures release notes are correctly aggregated for the current version.
# This is a workaround. Can be removed if the release process is fully aligned with reno.
- name: Delete next version rc0 tag in the CI environment
run: |
# Parse version X.Y.Z and increment Y for next minor version
IFS='.' read -r MAJOR MINOR _ <<< "${{ steps.version.outputs.current_release }}"
NEXT_MINOR=$((MINOR + 1))
NEXT_TAG="v${MAJOR}.${NEXT_MINOR}.0-rc0"
if git rev-parse --verify "$NEXT_TAG" >/dev/null 2>&1; then
git tag -d "$NEXT_TAG"
echo "Deleted local tag $NEXT_TAG"
else
echo "Tag $NEXT_TAG does not exist locally"
fi
- name: Generate release notes
env:
EARLIEST_VERSION: v${{ steps.version.outputs.current_release }}-rc1
run: |
reno report --no-show-source --ignore-cache --earliest-version "$EARLIEST_VERSION" -o relnotes.rst
- name: Convert to Markdown
uses: docker://pandoc/core:3.8@sha256:c7127705b9d84c1b4acbbe411a86e3a6d67ac57870654dc378b6fe636ab747df
with:
args: "--from rst --to gfm --syntax-highlighting=none --wrap=none relnotes.rst -o relnotes.md"
# We copy the relnotes file since the original one cannot be modified due to permissions
- name: Copy relnotes file
run: |
cat relnotes.md > enhanced_relnotes.md
- name: Add contributor list
# only for minor releases and minor release candidates (not bugfix releases)
if: endsWith(steps.version.outputs.current_release, '.0')
env:
GH_TOKEN: ${{ github.token }}
START: v${{ steps.version.outputs.current_release }}-rc0
END: ${{ github.ref_name }}
run: |
JQ_EXPR='[.commits[].author.login]
| map(select(. != null and . != "HaystackBot" and . != "dependabot[bot]" and . != "github-actions[bot]"))
| unique
| sort_by(ascii_downcase)
| map("@\(.)")
| join(", ")'
CONTRIBUTORS=$(gh api "repos/deepset-ai/haystack/compare/$START...$END" \
--jq "$JQ_EXPR") || { echo "Unable to fetch contributors"; exit 1; }
{
echo ""
echo "## 💙 Big thank you to everyone who contributed to this release!"
echo ""
echo "$CONTRIBUTORS"
} >> enhanced_relnotes.md
- name: Debug
run: |
cat enhanced_relnotes.md
- uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
bodyFile: "enhanced_relnotes.md"
prerelease: ${{ steps.version.outputs.current_pre_release != '' }}
allowUpdates: true