-
Notifications
You must be signed in to change notification settings - Fork 1.9k
76 lines (70 loc) · 2.56 KB
/
release-drafter.yml
File metadata and controls
76 lines (70 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Release Drafter
on:
workflow_dispatch:
inputs:
version:
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
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:
# 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:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: release-drafter/release-drafter@563bf132657a13ded0b01fcb723c5a58cdd824e2 # v7.2.1
with:
version: ${{ 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: ${{ inputs.version }}
secrets: inherit
# Upload the OAS schemas to the release object
add-oas-to-release:
needs:
- update_release_draft
- oas-fetch
runs-on: ubuntu-latest
steps:
- name: Load OAS files from artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: oas-*
- name: Upload Release Asset - OpenAPI Specification - YAML
id: upload-release-asset-yaml
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.update_release_draft.outputs.upload_url }}
asset_path: ./oas-yaml/oas.yaml
asset_name: oas.yaml
asset_content_type: application/vnd.oai.openapi
- name: Upload Release Asset - OpenAPI Specification - JSON
id: upload-release-asset-json
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.update_release_draft.outputs.upload_url }}
asset_path: ./oas-json/oas.json
asset_name: oas.json
asset_content_type: application/json