Skip to content

chore: update publish workflow to include snapshot input and PR creation #18

chore: update publish workflow to include snapshot input and PR creation

chore: update publish workflow to include snapshot input and PR creation #18

on:
workflow_dispatch:
inputs:
snapshot:
type: checkbox
description: "Is a snapshot release?"
required: true
default: true
jobs:
generate-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: "8.13"
- name: Install Post Processor
working-directory: generator/src/main/resources/post-processor
run: npm ci && npm run clean && npm run compile
- name: Build Project
run: gradle build
- name: Generate SDK
working-directory: generator
run: |
export KOTLIN_POST_PROCESS_FILE="npm run --prefix src/main/resources/post-processor process"
gradle openApiGenerate
- name: Open PR
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_PAT }}
commit-message: "chore: publishing docs for version ${{ env.NEW_DOCS_VERSION }}"
body: "This PR adds the reference documentation for version ${{ env.NEW_DOCS_VERSION }}."
title: "chore: reference docs update for version ${{ env.NEW_DOCS_VERSION }}"
branch: "docs-update-${{ env.NEW_DOCS_VERSION }}-$(date +'%Y%m%d%H%M%S')"
add-paths: .

Check failure on line 50 in .github/workflows/generate-publish-sdk.yaml

View workflow run for this annotation

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

Invalid workflow file

You have an error in your yaml syntax on line 50
- name: Publish SDK
working-directory: xap-sdk
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
GPG_SECRET: ${{ secrets.GPG_PRIVATE_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
if [ -z "${{ github.event.inputs.snapshot }}" ]; then
gradle publishToSonatype closeAndReleaseSonatypeStagingRepository
else
exit 1
# ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
fi