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

Restructure Release Drafter Flow #9345

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions .github/workflows/fetch-oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: Fetch OpenAPI Specifications

on:
workflow_call:
inputs:
version:
type: string
description: |
The version to be associated with the GitHub release that's created or updated.
This will override any version calculated by the release-drafter.
required: true

jobs:
oas_fetch:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release-2-tag-docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ jobs:
with:
release_number: ${{ github.event.inputs.release_number }}
secrets: inherit

release-drafter:
needs: release-docker-containers
uses: ./.github/workflows/release-drafter.yml
with:
version: ${{ github.event.inputs.release_number }}
secrets: inherit
41 changes: 27 additions & 14 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,43 @@ on:
description: |
The version to be associated with the GitHub release that's created or updated.
This will override any version calculated by the release-drafter.
required: false

push:
# branches to consider in the event; optional, defaults to all
branches:
- master
required: true
workflow_call:
inputs:
version:
type: string
description: |
The version to be associated with the GitHub release that's created or updated.
This will override any version calculated by the release-drafter.
required: true

jobs:
oas-fetch:
uses: ./.github/workflows/fetch-oas.yml
secrets: inherit

# Update the notes in the release drafter first
# If the following jobs fail, then we will at least have some release notes present
update_release_draft:
needs: oas-fetch
runs-on: ubuntu-latest
steps:
- name: Load OAS files from artifacts
uses: actions/download-artifact@v3

- name: Create Release
id: create_release
uses: release-drafter/[email protected]
with:
version: ${{github.event.inputs.version}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Generate the OAS schemas in another workflow
oas-fetch:
needs: update_release_draft
uses: ./.github/workflows/fetch-oas.yml
with:
version: ${{github.event.inputs.version}}
secrets: inherit
# Upload the OAS schemas to the release object
add-oas-to-release:
needs: oas-fetch
runs-on: ubuntu-latest
steps:
- name: Load OAS files from artifacts
uses: actions/download-artifact@v3

- name: Upload Release Asset - OpenAPI Specification - YAML
id: upload-release-asset-yaml
Expand All @@ -55,3 +66,5 @@ jobs:
asset_path: ./oas-json/oas.json
asset_name: oas.json
asset_content_type: application/json


Loading