Create Sui Release with Release Notes #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Notes Generator | |
on: | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: 'Sui Release Tag' | |
type: string | |
required: true | |
default: devnet-test-tag | |
previous_branch: | |
description: 'Previous Release Branch (Ex: releases/sui-vX.XX.X-release)' | |
type: string | |
required: true | |
default: releases/sui-v1.29.0-release | |
current_branch: | |
description: 'Current Release Branch (Ex: releases/sui-vX.XX.X-release)' | |
type: string | |
required: true | |
default: releases/sui-v1.30.0-release | |
env: | |
RELEASE_NOTES_FILE: "./release_notes.txt" | |
jobs: | |
get-release-notes: | |
name: Get Release Notes for ${{ inputs.release_tag }} release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ${{ inputs.previous_branch }} | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | |
with: | |
ref: ${{ inputs.previous_branch }} | |
- name: Get ${{ inputs.previous_branch }} commit | |
shell: bash | |
working-directory: ./ | |
run: | | |
echo "previous_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
- name: Checkout ${{ inputs.current_branch }} | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | |
with: | |
ref: ${{ inputs.current_branch }} | |
- name: Get ${{ inputs.current_branch }} commit | |
shell: bash | |
working-directory: ./ | |
run: | | |
echo "current_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
- name: Checkout main | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- name: Setup Python | |
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # pin@v5.0.0 | |
with: | |
python-version: 3.10.10 | |
- name: Generate Release Notes | |
shell: bash | |
working-directory: ./ | |
run: | | |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python ./scripts/release_notes.py generate ${{ env.previous_commit }} ${{ env.current_commit }} | tee -a ${{ env.RELEASE_NOTES_FILE }} | |
echo "### Full Log: https://github.com/MystenLabs/sui/commits/${{ inputs.release_tag }}" >> ${{ env.RELEASE_NOTES_FILE }} | |
if [[ ${{ inputs.release_tag }} == devnet* ]]; then | |
echo "pre_release=true" >> $GITHUB_ENV | |
else | |
echo "pre_release=false" >> $GITHUB_ENV | |
fi | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ inputs.release_tag }} | |
release_name: ${{ inputs.release_tag }} | |
body_path: ./release_notes.txt | |
draft: false | |
prerelease: ${{ env.pre_release }} |