Create Release Notes #4
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: Create Release Notes | |
on: | |
workflow_call: | |
inputs: | |
tag: | |
required: true | |
type: string | |
description: Tag to be used as the latest release anchor point. Can be new or existing. | |
auto-clear-release-candidate-notes: | |
type: boolean | |
default: true | |
description: Disable this to prevent the auto management of release candidate notes | |
outputs: | |
URL: | |
value: ${{ jobs.create-release.outputs.URL }} | |
description: Link to the release candidate | |
workflow_dispatch: | |
inputs: | |
tag: | |
required: true | |
type: string | |
description: Tag to be used as the latest release anchor point. Can be new or existing. | |
auto-clear-release-candidate-notes: | |
type: boolean | |
default: true | |
description: Disable this to prevent the auto management of release candidate notes | |
jobs: | |
create-release: | |
name: Create Release Notes | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
outputs: | |
URL: ${{ steps.release.outputs.URL }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
# We forcefully clone to retrieve the release_manager.py, so that it is available in consuming repositories | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
repository: "danielebra/simple-release-notes" | |
path: simple-release-notes | |
- name: Create Release | |
id: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO: ${{ github.repository }} | |
shell: bash | |
run: | | |
set -e | |
URL=$(python3 ./simple-release-notes/release_manager.py release ${{ inputs.tag }}) | |
echo "URL=$URL" >> $GITHUB_OUTPUT | |
clear-candidate: | |
name: Clear Release Candidate | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
if: ${{ inputs.auto-clear-release-candidate-notes == true }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
# We forcefully clone to retrieve the release_manager.py, so that it is available in consuming repositories | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
repository: "danielebra/simple-release-notes" | |
path: simple-release-notes | |
- name: Clear Candidate | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO: ${{ github.repository }} | |
shell: bash | |
run: python3 ./simple-release-notes/release_manager.py candidate clear |