-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 939 Bytes
/
ReleaseOnTagPush.yml
File metadata and controls
37 lines (30 loc) · 939 Bytes
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
name: Add OpenAPI JSON to Release
on:
push:
tags:
- "v*.*.*"
jobs:
attach-openapi-json:
name: Attach OpenAPI JSON to Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate OpenAPI JSON
run: |
python -c "from main import app; import json; open('openapi.json', 'w').write(json.dumps(app.openapi()))"
python -c "from main import app; import yaml; open('openapi.yaml', 'w').write(yaml.dump(app.openapi()))"
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
openapi.json
openapi.yaml