зеркало из https://github.com/Azure/ARO-RP.git
Auto-generate release note (#2878)
This commit is contained in:
Родитель
a6a1e57e0b
Коммит
12aa588dbc
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
# It checks if the tag is annotated, otherwise it fails.
|
||||
[ "$(git describe)" != "$(git describe --tags)" ] && echo "Tag must be annotated." && exit 1
|
||||
|
||||
CHANGELOG=$1
|
||||
CURRENT_TAG=$(git describe --abbrev=0)
|
||||
PREVIOUS_TAG=$(git describe --abbrev=0 "$CURRENT_TAG"^)
|
||||
|
||||
cat <<EOF > "$CHANGELOG"
|
||||
$(git tag -l --format='%(contents)' "$CURRENT_TAG")
|
||||
|
||||
<details><summary><b>Changes</b></summary>
|
||||
|
||||
$(git log --oneline --no-decorate "$PREVIOUS_TAG".."$CURRENT_TAG")
|
||||
|
||||
**Full Changelog**: https://github.com/Azure/ARO-RP/compare/$PREVIOUS_TAG...$CURRENT_TAG
|
||||
</details>
|
||||
EOF
|
|
@ -0,0 +1,29 @@
|
|||
name: release-note
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
fetch-depth: 0
|
||||
# ref and fetch-depth: 0 are required to retrieve tag annotations.
|
||||
# (see https://github.com/actions/runner-images/issues/1717)
|
||||
- name: Generate Changelog
|
||||
run: ./.github/generate_release_note.sh ${{ github.workspace }}/CHANGELOG.txt
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
body_path: ${{ github.workspace }}/CHANGELOG.txt
|
||||
name: Release ${{ github.ref_name }}
|
||||
draft: false
|
||||
prerelease: false
|
Загрузка…
Ссылка в новой задаче