Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport to branch(3.10) : Added merging the release notes workflow #1272

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/merge-release-notes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Merge release notes

on:
workflow_dispatch:

jobs:
merge-release-notes:
runs-on: ubuntu-latest

steps:
- name: Set version
id: version
run: |
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/v##g")
echo $VERSION
echo "version=${VERSION}" >> $GITHUB_OUTPUT

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Checkout release note scripts
uses: actions/checkout@v4
with:
repository: scalar-labs/actions
token: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }}
path: ${{ github.workspace }}
sparse-checkout-cone-mode: false
sparse-checkout: |
release-note-script/src/main/java

- name: Move scripts to the working directory
run: cp ${{ github.workspace }}/release-note-script/src/main/java/* ${{ github.workspace }}

- name: Checkout the ScalarDB's release notes
run: |
gh release view v${{ steps.version.outputs.version }} --repo scalar-labs/scalardb --json body -q .body > scalardb.md
gh release view v${{ steps.version.outputs.version }} --repo scalar-labs/scalardb-cluster --json body -q .body > cluster.md
gh release view v${{ steps.version.outputs.version }} --repo scalar-labs/scalardb-graphql --json body -q .body > graphql.md
gh release view v${{ steps.version.outputs.version }} --repo scalar-labs/scalardb-sql --json body -q .body > sql.md
env:
GH_TOKEN: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }}

- name: Create merged release note body
id: rn_body
run: |
java MergeReleaseNotes.java > rnbody.md

- name: Update release body
id: update_release_body
uses: ncipollo/release-action@v1
with:
allowUpdates: true
bodyFile: ./rnbody.md
name: v${{ steps.version.outputs.version }}
tag: v${{ steps.version.outputs.version }}
token: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }}
draft: true
prerelease: true