Skip to content

Commit a14c7ff

Browse files
committed
ci: publish from the ci workflow
1 parent 6f2b408 commit a14c7ff

2 files changed

Lines changed: 44 additions & 65 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ on:
33
branches:
44
- '**'
55
pull_request:
6+
repository_dispatch:
7+
types: [release]
8+
workflow_dispatch:
9+
inputs:
10+
json:
11+
description: Passed json from repository_dispatch
12+
required: true
13+
type: string
14+
version_postfix:
15+
description: Additional string to concatenate onto the existing version before release
16+
required: false
17+
type: string
18+
default: ''
619
workflow_call:
720
inputs:
821
ref:
@@ -13,6 +26,10 @@ on:
1326

1427
name: CI
1528

29+
env:
30+
PASSED_VERSION: ${{ (github.event_name == 'repository_dispatch' && github.event.client_payload || fromJSON(inputs.json || '{}'))['version'] }}
31+
VERSION_POSTPEND: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix || '' }}
32+
1633
jobs:
1734
generate:
1835
runs-on: ubuntu-latest
@@ -28,11 +45,14 @@ jobs:
2845
with:
2946
bundle: openapi-legacy.yaml
3047

48+
- if: env.VERSION_POSTPEND != ''
49+
run: yq '--inplace' ".info.version |= \"${PASSED_VERSION}${VERSION_POSTPEND}\"" openapi-legacy.yaml
50+
3151
- run: bash ./generate.sh openapi-legacy.yaml
3252

3353
- uses: actions/upload-artifact@v7
3454
with:
35-
name: generated-java
55+
name: java-generated
3656
path: .
3757
include-hidden-files: true
3858

@@ -45,7 +65,7 @@ jobs:
4565
steps:
4666
- uses: actions/download-artifact@v8
4767
with:
48-
name: generated-java
68+
name: java-generated
4969

5070
- uses: actions/setup-java@v5.7.0
5171
with:
@@ -54,3 +74,25 @@ jobs:
5474
cache: maven
5575

5676
- run: mvn -B package --no-transfer-progress
77+
78+
publish:
79+
needs:
80+
- generate
81+
- test
82+
if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch'
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v7
86+
87+
- uses: actions/download-artifact@v8
88+
with:
89+
name: java-generated
90+
91+
- run: rm -f openapi-legacy.yaml
92+
93+
- uses: JamesIves/github-pages-deploy-action@v4.9.0
94+
with:
95+
branch: main
96+
folder: .
97+
commit-message: Upgrade Java SDK to spec ${{ env.PASSED_VERSION }}${{ env.VERSION_POSTPEND }}
98+
tag: ${{ env.PASSED_VERSION }}${{ env.VERSION_POSTPEND }}

‎.github/workflows/release.yaml‎

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)