Skip to content

Commit 30b0410

Browse files
committed
chore: update publish workflow to include snapshot input and PR creation
1 parent 8600ef7 commit 30b0410

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/generate-publish-sdk.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
on:
2-
push:
2+
workflow_dispatch:
3+
inputs:
4+
snapshot:
5+
type: checkbox
6+
description: "Is a snapshot release?"
7+
required: true
8+
default: true
39

410
jobs:
511
generate-and-publish:
@@ -32,11 +38,27 @@ jobs:
3238
export KOTLIN_POST_PROCESS_FILE="npm run --prefix src/main/resources/post-processor process"
3339
gradle openApiGenerate
3440
35-
- name: Publish Snapshot
41+
- name: Open PR
42+
uses: peter-evans/create-pull-request@v7
43+
with:
44+
token: ${{ secrets.GITHUB_PAT }}
45+
commit-message: "chore: publishing docs for version ${{ env.NEW_DOCS_VERSION }}"
46+
body: "This PR adds the reference documentation for version ${{ env.NEW_DOCS_VERSION }}."
47+
title: "chore: reference docs update for version ${{ env.NEW_DOCS_VERSION }}"
48+
branch: "docs-update-${{ env.NEW_DOCS_VERSION }}-$(date +'%Y%m%d%H%M%S')"
49+
add-paths: .
50+
51+
- name: Publish SDK
3652
working-directory: xap-sdk
3753
env:
3854
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
3955
GPG_SECRET: ${{ secrets.GPG_PRIVATE_KEY }}
4056
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
4157
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
42-
run: gradle publishSnapshot
58+
run: |
59+
if [ -z "${{ github.event.inputs.snapshot }}" ]; then
60+
gradle publishToSonatype closeAndReleaseSonatypeStagingRepository
61+
else
62+
exit 1
63+
# ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
64+
fi

0 commit comments

Comments
 (0)