-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.93 KB
/
generator-publish-sources.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
name: Generate and Publish Sources
on:
workflow_call:
inputs:
name:
description: 'SDK Name'
required: true
type: string
version:
description: 'SDK Version'
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: sdk
path: generator/sdk
- uses: actions/download-artifact@v4
with:
name: specs
path: generator/sdk
- name: Add Generated Source Code
working-directory: generator/sdk
run: |
rm -rf ../../release/"${{github.event.inputs.name}}"
mkdir -p ../../release/"${{github.event.inputs.name}}"/src
cp -r ./client ../../release/"${{github.event.inputs.name}}"/src/
cp -r ./core ../../release/"${{github.event.inputs.name}}"/src/
cp -r ./models ../../release/"${{github.event.inputs.name}}"/src/
cp -r ./docs ../../release/"${{github.event.inputs.name}}"/
cp ./.prettierrc ../../release/"${{github.event.inputs.name}}"/src/
cp ./index.ts ../../release/"${{github.event.inputs.name}}"/src/
cp ./README.md ../../release/"${{github.event.inputs.name}}"/src/
cp ./package.json ../../release/"${{github.event.inputs.name}}"/src/
cp ./tsconfig.json ../../release/"${{github.event.inputs.name}}"/src/
cp ./specs.yaml ../../release/"${{github.event.inputs.name}}"/src/
- name: Create PR
uses: peter-evans/create-pull-request@v7
with:
branch: "${{github.event.inputs.name}}-${{github.event.inputs.version}}"
commit-message: "chore: Publish ${{github.event.inputs.name}} [${{github.event.inputs.version}}] SDK"
title: "chore: Publish ${{github.event.inputs.name}} [${{github.event.inputs.version}}] SDK"
add-paths: |
release/*