Skip to content

ci(swagger-ui-react-release): add GA workflow for release #10495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/release-swagger-ui-react.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release SwaggerUI React

on:
workflow_run:
workflows: ["Release SwaggerUI"]
types:
- completed
branches: [ master ]

jobs:
release-swagger-ui-react:
if: github.event.workflow_run.conclusion == 'success'
name: Release swagger-ui-react npm package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
ref: master

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci

- name: Download build artifact
uses: actions/github-script@v7
with:
script: |
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
const matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "dist"
})[0];
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
const fs = require('fs');
fs.writeFileSync('${{github.workspace}}/dist.zip', Buffer.from(download.data));
- run: |
unzip -o dist.zip -d dist

- name: Publish to GitHub Package Registry
run: ./run.sh
working-directory: ./flavors/swagger-ui-react/release
env:
NPM_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
PUBLISH_FLAVOR_REACT: true