forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (68 loc) · 2.38 KB
/
release-drafter.yml
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/[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:
- update_release_draft
- 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
uses: actions/upload-release-asset@v1
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@v1
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