Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devel/generate-npm-client' into pr/generate-npm-client
Browse files Browse the repository at this point in the history
YaSuenag committed Nov 27, 2024
2 parents ba96458 + 8fb7ba7 commit cd25598
Showing 4 changed files with 37 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/4-release.yaml
Original file line number Diff line number Diff line change
@@ -67,9 +67,9 @@ jobs:
permissions:
contents: write
packages: write
pull-requests: write
with:
# We cannot use environment variables here due to workflow limitation.
# https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/reusing-workflows#limitations
registry: ghcr.io
image-repo: ${{ github.repository }}
branch: main # Every releases should be happened on main branch.
43 changes: 34 additions & 9 deletions .github/workflows/4.a-generate-webapi-clients.yaml
Original file line number Diff line number Diff line change
@@ -13,9 +13,6 @@ on:
type: string
required: false
default: latest
branch:
type: string
required: true
workflow_dispatch:
inputs:
registry:
@@ -30,14 +27,11 @@ on:
type: string
required: false
default: latest
branch:
type: string
required: true
default: dev

permissions:
contents: write
packages: write
pull-requests: write

jobs:
detect-api-version:
@@ -53,12 +47,43 @@ jobs:
with:
image: ${{ needs.detect-api-version.outputs.image }}
apiver: ${{ needs.detect-api-version.outputs.apiver }}
ref: ${{ inputs.branch }}

generate-npm-client:
needs: detect-api-version
uses: ./.github/workflows/4.a.1-generate-webapi-client-npm.yaml
with:
image: ${{ needs.detect-api-version.outputs.image }}
apiver: ${{ needs.detect-api-version.outputs.apiver }}
ref: ${{ inputs.branch }}

push-apidocs:
runs-on: ubuntu-latest
needs:
- detect-api-version
- generate-java-client
- generate-npm-client
env:
DOCPATH: casdk-docs/static/client-apidocs/${{ needs.detect-api-version.outputs.apiver }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: dev
- name: Extract Javadoc
uses: actions/download-artifact@v4
with:
name: javadoc
path: ${{ env.DOCPATH }}/java
- name: Extract TypeDoc
uses: actions/download-artifact@v4
with:
name: typedoc
path: ${{ env.DOCPATH }}/npm
- name: Create PR for Client API docs
uses: peter-evans/create-pull-request@v7
with:
commit-message: "Add Client API documents for WebAPI ${{ needs.detect-api-version.outputs.apiver }}"
branch: gha/pr/webapidoc-${{ needs.detect-api-version.outputs.apiver }}
delete-branch: true
title: "Add Client API documents for WebAPI ${{ needs.detect-api-version.outputs.apiver }}"
body: |
This PR has been created by 4.a-generate-webapi-clients.yaml due to WebAPI version update.
37 changes: 0 additions & 37 deletions .github/workflows/4.a.1-generate-webapi-client-java.yaml
Original file line number Diff line number Diff line change
@@ -9,9 +9,6 @@ on:
apiver:
required: true
type: string
ref:
required: true
type: string

jobs:
generate-java-client:
@@ -57,37 +54,3 @@ jobs:
with:
name: javadoc
path: work/target/apidocs

push-javadoc:
needs: generate-java-client
concurrency:
group: push-to-doc-website
runs-on: ubuntu-latest
env:
DOCPATH: casdk-docs/static/client-apidocs/${{ inputs.apiver }}/java
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Checkout the latest commit
run: git checkout ${{ inputs.ref }}
- name: Prepare
run: mkdir -p ${{ env.DOCPATH }}
- name: Download Javadoc
uses: actions/download-artifact@v4
with:
name: javadoc
path: ${{ env.DOCPATH }}
- name: Push Javadoc
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add ${{ env.DOCPATH }}
git commit -m "Add Javadoc for WebAPI ${{ inputs.apiver }}"
git push origin ${{ inputs.ref }}
env:
GITHUB_TOKEN: ${{ github.token }}
41 changes: 2 additions & 39 deletions .github/workflows/4.a.1-generate-webapi-client-npm.yaml
Original file line number Diff line number Diff line change
@@ -9,9 +9,6 @@ on:
apiver:
required: true
type: string
ref:
required: true
type: string

jobs:
generate-npm-client:
@@ -31,10 +28,10 @@ jobs:
env:
API: http://localhost:8080/api/v1/swagger.yaml
steps:
- name: Setup Node.js 18
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 22.x
registry-url: https://npm.pkg.github.com
- name: Prepare
run: |
@@ -66,37 +63,3 @@ jobs:
with:
name: typedoc
path: docs

push-typedoc:
needs: generate-npm-client
concurrency:
group: push-to-doc-website
runs-on: ubuntu-latest
env:
DOCPATH: casdk-docs/static/client-apidocs/${{ inputs.apiver }}/npm
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Checkout the latest commit
run: git checkout ${{ inputs.ref }}
- name: Prepare
run: mkdir -p ${{ env.DOCPATH }}
- name: Download TypeDoc
uses: actions/download-artifact@v4
with:
name: typedoc
path: ${{ env.DOCPATH }}
- name: Push TypeDoc
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add ${{ env.DOCPATH }}
git commit -m "Add TypeDoc for WebAPI ${{ inputs.apiver }}"
git push origin ${{ inputs.ref }}
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit cd25598

Please sign in to comment.