forked from bonitasoft/bonita-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 2.39 KB
/
release.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
name: release
on:
push:
branches:
- release/*
jobs:
build:
name: Release pipeline
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npm run build
- run: npm run package
- name: Extract version
shell: bash
run: echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/heads/} | sed 's/release\///g')"
id: extract_version
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.extract_version.outputs.version }}
release_name: Release ${{ steps.extract_version.outputs.version }}
body: "TODO"
draft: false
prerelease: false
- name: Upload OpenAPI YAML Release Asset
id: upload-yaml-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/openapi.yaml
asset_name: bonita-openapi-${{ steps.extract_version.outputs.version }}.yaml
asset_content_type: text/x-yaml
- name: Upload Postman Collection Release Asset
id: upload-postman-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/postman.json
asset_name: bonita-postman-collection-${{ steps.extract_version.outputs.version }}.json
asset_content_type: application/json