-
Notifications
You must be signed in to change notification settings - Fork 61
60 lines (58 loc) · 2.01 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v2
- run: npm i -g @apidevtools/swagger-cli@4
- name: Bundle yaml spec
run: "swagger-cli bundle ./builder-oapi.yaml -r -t yaml -o ./deploy/builder-oapi.yaml"
- name: Bundle json spec
run: "swagger-cli bundle ./builder-oapi.yaml -r -t json -o ./deploy/builder-oapi.json"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Yaml Bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./deploy/builder-oapi.yaml
asset_name: builder-oapi.yaml
asset_content_type: text/x-yaml
- name: Upload Json Bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./deploy/builder-oapi.json
asset_name: builder-oapi.json
asset_content_type: application/json
- name: Rollback Release
if: failure()
uses: author/action-rollback@stable
with:
# Using a known release ID
id: ${{ steps.create_release.id }}
# Using a tag name
tag: ${{ github.ref }}
# Always delete the tag, even if a release is not associated with it.
always_delete_tag: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}