-
Notifications
You must be signed in to change notification settings - Fork 7
136 lines (122 loc) · 5.01 KB
/
release_build.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: "Release :: Build"
on:
workflow_call:
inputs:
dry_run:
type: boolean
required: true
base_ref:
type: string
required: true
tag:
type: string
required: false
default: "0.0.0"
upload_asset_url:
type: string
required: false
default: ""
runners:
type: string
required: false
default: '{"serverless_logic_web_tools":"false"}'
secrets:
kie_group_tools_token:
required: false
gh_token:
required: false
env:
KIE_TOOLS_BUILD__runLinters: "false"
KIE_TOOLS_BUILD__runTests: "false"
KIE_TOOLS_BUILD__runEndToEndTests: "false"
KIE_TOOLS_BUILD__buildContainerImages: "false"
jobs:
extract_runners:
runs-on: ubuntu-latest
outputs:
serverless_logic_web_tools: ${{ steps.set_runners.outputs.serverless_logic_web_tools }}
steps:
- name: "Set Runners"
id: set_runners
shell: bash
run: |
echo "serverless_logic_web_tools=${{ fromJSON(inputs.runners).serverless_logic_web_tools }}" >> $GITHUB_OUTPUT
- name: "Print Runners"
shell: bash
run: |
echo "serverless_logic_web_tools: ${{ steps.set_runners.outputs.serverless_logic_web_tools }}"
serverless_logic_web_tools:
env:
SERVERLESS_LOGIC_WEB_TOOLS__version: "${{ inputs.tag }}"
SERVERLESS_LOGIC_WEB_TOOLS__samplesRepositoryRef: "${{ inputs.tag }}"
SERVERLESS_LOGIC_WEB_TOOLS__buildInfo: ""
SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageRegistry: "docker.io"
SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageAccount: "apache"
SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageName: "incubator-kie-serverless-logic-web-tools-swf-builder"
SERVERLESS_LOGIC_WEB_TOOLS__swfBuilderImageTag: "${{ inputs.tag }}"
SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageRegistry: "docker.io"
SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageAccount: "apache"
SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageName: "incubator-kie-serverless-logic-web-tools-base-builder"
SERVERLESS_LOGIC_WEB_TOOLS__baseBuilderImageTag: "${{ inputs.tag }}"
SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageRegistry: "docker.io"
SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageAccount: "apache"
SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageName: "incubator-kie-serverless-logic-web-tools-swf-dev-mode"
SERVERLESS_LOGIC_WEB_TOOLS__swfDevModeImageTag: "${{ inputs.tag }}"
DASHBUILDER__viewerImageRegistry: "docker.io"
DASHBUILDER__viewerImageAccount: "apache"
DASHBUILDER__viewerImageName: "incubator-kie-dashbuilder-viewer"
SERVERLESS_LOGIC_WEB_TOOLS__dashbuilderViewerImageTag: "${{ inputs.tag }}"
SERVERLESS_LOGIC_WEB_TOOLS__corsProxyUrl: "https://cors-proxy-kie-sandbox.rhba-0ad6762cc85bcef5745bb684498c2436-0000.us-south.containers.appdomain.cloud"
if: ${{ always() && needs.extract_runners.outputs.serverless_logic_web_tools == 'true' }}
runs-on: ubuntu-latest
needs: [extract_runners]
steps:
- name: "Checkout kie-tools"
uses: actions/checkout@v3
with:
path: kie-tools
repository: apache/incubator-kie-tools
- name: "Checkout serverless-logic-sandbox-deployment"
if: ${{ !inputs.dry_run }}
uses: actions/checkout@v3
with:
path: ${{ github.workspace }}/serverless-logic-sandbox-deployment
fetch-depth: 0
token: ${{ secrets.kie_group_tools_token }}
repository: kiegroup/serverless-logic-sandbox-deployment
ref: gh-pages
- name: "Cache Maven packages"
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: ~/.m2
key: ${{ runner.os }}-serverless-logic-web-tools-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-serverless-logic-web-tools-m2
- name: "Setup environment"
id: setup_env
uses: ./kie-tools/.github/actions/setup-env
with:
working_dir: kie-tools
- name: "Bootstrap"
id: bootstrap
uses: ./kie-tools/.github/actions/bootstrap
with:
working_dir: kie-tools
pnpm_filter_string: -F @kie-tools/serverless-logic-web-tools...
- name: "Build"
working-directory: ${{ github.workspace }}/kie-tools
run: |
pnpm ${{ steps.bootstrap.outputs.pnpm_filter_string }} build:prod
- name: "Deploy to GitHub Pages (serverless-logic-sandbox-deployment)"
if: ${{ !inputs.dry_run }}
working-directory: ${{ github.workspace }}/serverless-logic-sandbox-deployment
shell: bash
run: |
echo "Reset deployment dir"
shopt -s extglob
rm -rf -- !("dev"|"staging"|".nojekyll"|"CNAME"|"0.25.0"|"schemas")
echo "Copy resources"
cp -r ${{ github.workspace }}/kie-tools/packages/serverless-logic-web-tools/dist/* .
echo "Commit changes and push"
git add .
git commit -m "Deploy ${{ inputs.tag }}"
git push origin gh-pages