Skip to content

Commit

Permalink
Update finalize release workflow for testing purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgur00 committed Jan 8, 2025
1 parent b7a2b99 commit b8d81fb
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 148 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/fetch_updated_release_notes_file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Fetch Updated Release Notes File

on:
workflow_call:
inputs:
version-name:
description: "Version Name"
required: true
type: string
outputs:
description: "Filepath for the updated release notes file"
updated-release-notes-filepath: ${{ jobs.fetch_updated_release_notes_file.outputs.updated-release-notes-filepath }}


jobs:
fetch_updated_release_notes_file:
name: Fetch Updated Release Notes File
runs-on: ubuntu-latest
outputs:
updated-release-notes-filepath: ${{ steps.fetch_updated_release_notes_file.outputs.updated-release-notes-filepath }}

steps:
- uses: actions/checkout@v4
with:
ref: "release-notes-test-9.9.9"

- name: Fetch filepath for updated release notes file
id: fetch_updated_release_notes_file
env:
PROJECT_ROOT: ${{ github.workspace }}
VERSION_NAME: ${{ inputs.version-name }}
run: |
chmod +x scripts/fetch_updated_release_notes_file.sh
UPDATED_RELEASE_NOTES_FILEPATH=$(./scripts/fetch_updated_release_notes_file.sh $PROJECT_ROOT $VERSION_NAME)
echo -e "updated-release-notes-filepath=$UPDATED_RELEASE_NOTES_FILEPATH" >> $GITHUB_OUTPUT
echo -e $UPDATED_RELEASE_NOTES_FILEPATH
26 changes: 0 additions & 26 deletions .github/workflows/fetch_version_name_from_release_notes.yml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/workflows/finalize_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version-name:
description: "Version name of the build"
description: "Version Name"
required: true
type: string

Expand All @@ -13,13 +13,5 @@ jobs:
name: Update release notes
uses: ./.github/workflows/update_release_notes.yml
secrets: inherit
needs: fetch_version_name
with:
version-name: ${{ inputs.version-name }}
publish_github_release:
name: Update release notes
uses: ./.github/workflows/publish_github_release.yml
secrets: inherit
needs: [fetch_version_name, update_release_notes]
with:
version-name: ${{ inputs.version-name }}
43 changes: 43 additions & 0 deletions .github/workflows/update_github_release_notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update GitHub Release Notes

on:
workflow_call:
inputs:
version-name:
description: "Version Name"
required: true
type: string
updated-release-notes-filepath:
description: "Updated Release Notes Filepath"
required: true
type: string
jobs:
update_release_notes:
name: Update Release Notes
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: "release-notes-test-9.9.9"

- name: Print updated release notes
run: |
cat ${{ inputs.updated-release-notes-filepath }}
# Update Github release with the updated release notes
- name: Update Github release notes
id: update_github_release_notes
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_NAME: ${{ inputs.version-name }}
BODY_FILE: ${{ inputs.updated-release-notes-filepath }}
with:
token: ${{ env.GITHUB_TOKEN }}
tag: ${{ env.VERSION_NAME }}
allowUpdates: true
updateOnlyUnreleased: true
omitNameDuringUpdate: true
draft: true
bodyFile: ${{ env.BODY_FILE }}
61 changes: 21 additions & 40 deletions .github/workflows/update_release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,40 @@ on:
workflow_call:
inputs:
version-name:
description: "Version Name"
required: true
type: string

jobs:
fetch_updated_release_notes_file:
name: Fetch Updated Release Notes File
runs-on: ubuntu-latest
outputs:
updated-release-notes-filepath: ${{ steps.fetch_updated_release_notes_file.outputs.updated-release-notes-filepath }}

steps:
- uses: actions/checkout@v4
with:
ref: "release-notes"

- name: Fetch filepath for updated release notes file
id: fetch_updated_release_notes_file
env:
PROJECT_ROOT: ${{ github.workspace }}
VERSION_NAME: ${{ inputs.version-name }}
run: |
chmod +x scripts/fetch_updated_release_notes_file.sh
UPDATED_RELEASE_NOTES_FILEPATH=$(./scripts/fetch_updated_release_notes_file.sh $PROJECT_ROOT $VERSION_NAME)
echo -e "updated-release-notes-filepath=$UPDATED_RELEASE_NOTES_FILEPATH" >> $GITHUB_OUTPUT
echo -e $UPDATED_RELEASE_NOTES_FILEPATH
update_release_notes:
name: Update Release Notes
create_github_release:
runs-on: ubuntu-latest
needs: fetch_updated_release_notes_file

steps:
- uses: actions/checkout@v4
with:
ref: "release-notes"

- name: Print updated release notes
run: |
cat ${{ needs.fetch_updated_release_notes_file.outputs.updated-release-notes-filepath }}
# Update Github release with the updated release notes
- name: Update Github release notes
id: update_github_release_notes
# Create a Github release with release notes.
- name: Create Github release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_NAME: ${{ inputs.version-name }}
BODY_FILE : ${{ needs.fetch_updated_release_notes_file.outputs.updated-release-notes-filepath }}
VERSION_NAME: "9.9.9"
with:
token: ${{ env.GITHUB_TOKEN }}
tag: ${{ env.VERSION_NAME }}
allowUpdates: true
updateOnlyUnreleased: true
omitNameDuringUpdate: true
name: ${{ env.VERSION_NAME }}
draft: true
bodyFile: ${{ env.BODY_FILE }}

fetch_updated_release_notes_file:
name: Fetch Updated Release Notes File
needs: create_github_release
uses: ./.github/workflows/fetch_updated_release_notes_file.yml
with:
version-name: ${{ inputs.version-name }}

update_release_notes:
name: Update Github Release Notes
uses: ./.github/workflows/update_github_release_notes.yml
needs: fetch_updated_release_notes_file
with:
version-name: ${{ inputs.version-name }}
updated-release-notes-filepath: ${{ needs.fetch_updated_release_notes_file.outputs.updated-release-notes-filepath }}
40 changes: 0 additions & 40 deletions scripts/fetch_release_notes_version_name.sh

This file was deleted.

33 changes: 0 additions & 33 deletions scripts/fetch_updated_release_notes_file.sh

This file was deleted.

0 comments on commit b8d81fb

Please sign in to comment.