mirror of
https://github.com/quay/quay.git
synced 2026-01-26 06:21:37 +03:00
65 lines
2.4 KiB
YAML
65 lines
2.4 KiB
YAML
---
|
|
name: Prepare Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
branch:
|
|
description: 'the branch to prepare the release against'
|
|
required: true
|
|
default: 'master'
|
|
tag:
|
|
description: 'the tag to be released'
|
|
required: true
|
|
jira:
|
|
description: 'PROJQUAY jira release issue'
|
|
required: true
|
|
|
|
jobs:
|
|
prepare:
|
|
name: Prepare Release
|
|
runs-on: 'ubuntu-latest'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.event.inputs.branch }}
|
|
- name: Changelog
|
|
run: |
|
|
curl -o /tmp/git-chglog.tar.gz -fsSL\
|
|
https://github.com/git-chglog/git-chglog/releases/download/v0.15.4/git-chglog_0.15.4_linux_amd64.tar.gz
|
|
tar xvf /tmp/git-chglog.tar.gz --directory /tmp
|
|
chmod u+x /tmp/git-chglog
|
|
echo "creating change log for tag: ${{ github.event.inputs.tag }}"
|
|
|
|
# Get the y stream version from the tag
|
|
Y_STREAM_VERSION=$(echo "${{ github.event.inputs.tag }}" | sed 's/^v//' | awk -F'.' '{print $2}')
|
|
|
|
# build the regex in the form of "v3.(6|7|8|9).*" for the y-stream
|
|
for (( i=6; i<=$Y_STREAM_VERSION; i++ )); do
|
|
if [ -z "$Y_STREAM_REGEX" ]; then
|
|
Y_STREAM_REGEX="$i"
|
|
else
|
|
Y_STREAM_REGEX="${Y_STREAM_REGEX}|${i}"
|
|
fi
|
|
done
|
|
TAG_PATTERN="v3.($Y_STREAM_REGEX).*"
|
|
|
|
# Generate the changelog using the tag pattern
|
|
/tmp/git-chglog --next-tag "${{ github.event.inputs.tag }}" --tag-filter-pattern $TAG_PATTERN -o CHANGELOG.md v3.6.0-alpha.4..
|
|
- name: Modify changelog URL to point to current y-stream
|
|
run: |
|
|
echo "modifying changelog URL to point to current y-stream release."
|
|
QUAY_VERSION=$(echo ${{ github.event.inputs.branch }} | cut -d'-' -f2)
|
|
sed -in --regexp-extended "s/\/[0-9\.]+\//\/$QUAY_VERSION\//" CHANGELOG.md
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v3.5.1
|
|
with:
|
|
title: "${{ github.event.inputs.tag }} Changelog Bump"
|
|
body: "This is an automated changelog commit."
|
|
commit-message: "chore: ${{ github.event.inputs.tag }} changelog bump (${{ github.event.inputs.jira }})"
|
|
branch: "ready-${{ github.event.inputs.tag }}"
|
|
signoff: true
|
|
delete-branch: true
|