forked from admin/services_core
Update Database dan ALL yang di butuhkan
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report an issue you're experiencing
|
||||
|
||||
---
|
||||
|
||||
<!---
|
||||
Thanks for filing a bug report! 😄
|
||||
|
||||
Before you submit, please read the following:
|
||||
|
||||
If you're here to report a security issue, please STOP writing an issue and
|
||||
contact us at security@swagger.io instead!
|
||||
|
||||
Search open/closed issues before submitting!
|
||||
|
||||
Issues on GitHub are only related to problems of Swagger-UI itself. We'll try
|
||||
to offer support here for your use case, but we can't offer help with projects
|
||||
that use Swagger-UI indirectly, like Springfox or swagger-node.
|
||||
|
||||
Likewise, we can't accept bugs in the Swagger/OpenAPI specifications
|
||||
themselves, or anything that violates the specifications.
|
||||
-->
|
||||
|
||||
### Q&A (please complete the following information)
|
||||
- OS: [e.g. macOS]
|
||||
- Browser: [e.g. chrome, safari]
|
||||
- Version: [e.g. 22]
|
||||
- Method of installation: [e.g. npm, dist assets]
|
||||
- Swagger-UI version: [e.g. 3.10.0]
|
||||
- Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]
|
||||
|
||||
### Content & configuration
|
||||
<!--
|
||||
Provide us with a way to see what you're seeing,
|
||||
so that we can fix your issue.
|
||||
-->
|
||||
|
||||
Example Swagger/OpenAPI definition:
|
||||
```yaml
|
||||
# your YAML here
|
||||
```
|
||||
|
||||
Swagger-UI configuration options:
|
||||
```js
|
||||
SwaggerUI({
|
||||
// your config options here
|
||||
})
|
||||
```
|
||||
|
||||
```
|
||||
?yourQueryStringConfig
|
||||
```
|
||||
|
||||
### Describe the bug you're encountering
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
### To reproduce...
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
### Expected behavior
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
### Screenshots
|
||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||
|
||||
### Additional context or thoughts
|
||||
<!-- Add any other context about the problem here. -->
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature or enhancement for this project
|
||||
|
||||
---
|
||||
|
||||
### Content & configuration
|
||||
|
||||
Swagger/OpenAPI definition:
|
||||
```yaml
|
||||
# your YAML here
|
||||
```
|
||||
|
||||
Swagger-UI configuration options:
|
||||
```js
|
||||
SwaggerUI({
|
||||
// your config options here
|
||||
})
|
||||
```
|
||||
|
||||
```
|
||||
?yourQueryStringConfig
|
||||
```
|
||||
|
||||
|
||||
### Is your feature request related to a problem?
|
||||
<!--
|
||||
Please provide a clear and concise description of what the problem is.
|
||||
"I'm always frustrated when..."
|
||||
-->
|
||||
|
||||
### Describe the solution you'd like
|
||||
<!-- A clear and concise description of what you want to happen. -->
|
||||
|
||||
### Describe alternatives you've considered
|
||||
<!--
|
||||
A clear and concise description of any alternative solutions or features
|
||||
you've considered.
|
||||
-->
|
||||
|
||||
### Additional context
|
||||
<!-- Add any other context or screenshots about the feature request here. -->
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
name: Support
|
||||
about: Ask a question or request help with your implementation.
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
We can only offer support for Swagger-UI itself.
|
||||
|
||||
If you're having a problem with a library that uses Swagger-UI
|
||||
(for example, Springfox or swagger-node), please open an issue
|
||||
in that project's repository instead.
|
||||
-->
|
||||
|
||||
### Q&A (please complete the following information)
|
||||
- OS: [e.g. macOS]
|
||||
- Browser: [e.g. chrome, safari]
|
||||
- Version: [e.g. 22]
|
||||
- Method of installation: [e.g. npm, dist assets]
|
||||
- Swagger-UI version: [e.g. 3.10.0]
|
||||
- Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]
|
||||
|
||||
### Content & configuration
|
||||
<!-- Provide us with a way to see what you're seeing, so that we can help. -->
|
||||
|
||||
Swagger/OpenAPI definition:
|
||||
```yaml
|
||||
# your YAML here
|
||||
```
|
||||
|
||||
Swagger-UI configuration options:
|
||||
```js
|
||||
SwaggerUI({
|
||||
// your config options here
|
||||
})
|
||||
```
|
||||
|
||||
```
|
||||
?yourQueryStringConfig
|
||||
```
|
||||
|
||||
### Screenshots
|
||||
<!-- If applicable, add screenshots to help give context to your problem. -->
|
||||
|
||||
### How can we help?
|
||||
<!-- Your question or problem goes here! -->
|
||||
@@ -0,0 +1,35 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "23:00"
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
include: "scope"
|
||||
open-pull-requests-limit: 3
|
||||
ignore:
|
||||
# node-fetch must be synced manually
|
||||
- dependency-name: "node-fetch"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
# Look for a `Dockerfile` in the `root` directory
|
||||
directory: "/"
|
||||
# Check for updates once a week
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
time: "23:00"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
target-branch: "master"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "23:00"
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
include: "scope"
|
||||
open-pull-requests-limit: 3
|
||||
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
daysUntilLock: 365
|
||||
skipCreatedBefore: 2017-03-29 # initial release of Swagger UI 3.0.0
|
||||
exemptLabels: []
|
||||
lockLabel: "locked-by: lock-bot"
|
||||
setLockReason: false
|
||||
only: issues
|
||||
lockComment: false
|
||||
# lockComment: |
|
||||
# Locking due to inactivity.
|
||||
|
||||
# This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content.
|
||||
|
||||
# If you think you're experiencing something similar to what you've found here: please [open a new issue](https://github.com/swagger-api/swagger-ui/issues/new/choose), follow the template, and reference this issue in your report.
|
||||
|
||||
# Thanks!
|
||||
@@ -0,0 +1,55 @@
|
||||
<!--- Provide a general summary of your changes in the Title above -->
|
||||
|
||||
### Description
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
|
||||
|
||||
### Motivation and Context
|
||||
<!--- Why is this change required? What problem does it solve? -->
|
||||
<!--- If it fixes an open issue, please link to the issue here. -->
|
||||
<!--- Use the magic "Fixes #1234" format, so the issues are -->
|
||||
<!--- automatically closed when this PR is merged. -->
|
||||
|
||||
|
||||
|
||||
### How Has This Been Tested?
|
||||
<!--- Please describe in detail how you manually tested your changes. -->
|
||||
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||
<!--- see how your change affects other areas of the code, etc. -->
|
||||
|
||||
|
||||
|
||||
### Screenshots (if appropriate):
|
||||
|
||||
|
||||
|
||||
## Checklist
|
||||
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||
|
||||
### My PR contains...
|
||||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
||||
- [ ] No code changes (`src/` is unmodified: changes to documentation, CI, metadata, etc.)
|
||||
- [ ] Dependency changes (any modification to dependencies in `package.json`)
|
||||
- [ ] Bug fixes (non-breaking change which fixes an issue)
|
||||
- [ ] Improvements (misc. changes to existing features)
|
||||
- [ ] Features (non-breaking change which adds functionality)
|
||||
|
||||
### My changes...
|
||||
- [ ] are breaking changes to a public API (config options, System API, major UI change, etc).
|
||||
- [ ] are breaking changes to a private API (Redux, component props, utility functions, etc.).
|
||||
- [ ] are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
|
||||
- [ ] are not breaking changes.
|
||||
|
||||
### Documentation
|
||||
- [ ] My changes do not require a change to the project documentation.
|
||||
- [ ] My changes require a change to the project documentation.
|
||||
- [ ] If yes to above: I have updated the documentation accordingly.
|
||||
|
||||
### Automated tests
|
||||
- [ ] My changes can not or do not need to be tested.
|
||||
- [ ] My changes can and should be tested by unit and/or integration tests.
|
||||
- [ ] If yes to above: I have added tests to cover my changes.
|
||||
- [ ] If yes to above: I have taken care to cover edge cases in my tests.
|
||||
- [ ] All new and existing tests passed.
|
||||
@@ -0,0 +1,63 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ "master" ]
|
||||
schedule:
|
||||
- cron: '16 04 * * 2'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Use only 'java' to analyze code written in Java, Kotlin or both
|
||||
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
config: |
|
||||
paths-ignore:
|
||||
- 'dist/'
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v4
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
@@ -0,0 +1,40 @@
|
||||
name: Merge me!
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches: [ master, next ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
merge-me:
|
||||
name: Merge me!
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# This first step will fail if there's no metadata and so the approval
|
||||
# will not occur.
|
||||
- name: Dependabot metadata
|
||||
id: dependabot-metadata
|
||||
uses: dependabot/fetch-metadata@v3.0.0
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
# Here the PR gets approved.
|
||||
- name: Approve a PR
|
||||
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
|
||||
run: gh pr review --approve "$PR_URL"
|
||||
env:
|
||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
||||
GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
|
||||
# Finally, tell dependabot to merge the PR if all checks are successful
|
||||
- name: Instruct dependabot to squash & merge
|
||||
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
|
||||
uses: mshick/add-pr-comment@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
|
||||
allow-repeats: true
|
||||
message: |
|
||||
@dependabot squash and merge
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
name: Build & Push SwaggerUI unstable Docker image
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Node.js CI"]
|
||||
types:
|
||||
- completed
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
|
||||
build-push-unstable:
|
||||
if: github.event.workflow_run.conclusion == 'success'
|
||||
name: Build & Push SwaggerUI unstable Docker image
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
cache-dependency-path: package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build SwaggerUI
|
||||
run: npm run build
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Log in to DockerHub
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_SB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_SB_PASSWORD }}
|
||||
|
||||
- name: Build docker image and push
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm/v6,linux/arm64,linux/386,linux/ppc64le
|
||||
provenance: false
|
||||
tags: swaggerapi/swagger-ui:unstable
|
||||
@@ -0,0 +1,77 @@
|
||||
name: Build & Push SwaggerUI Docker image
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Release SwaggerUI"]
|
||||
types:
|
||||
- completed
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
|
||||
build-push:
|
||||
if: github.event.workflow_run.conclusion == 'success'
|
||||
name: Build & Push SwaggerUI Docker image
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
cache-dependency-path: package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build SwaggerUI
|
||||
run: npm run build
|
||||
|
||||
- name: Determine released version
|
||||
uses: actions/github-script@v9
|
||||
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 == "released-version"
|
||||
})[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}}/released-version.zip', Buffer.from(download.data));
|
||||
- run: |
|
||||
unzip released-version.zip
|
||||
RELEASED_VERSION=$(cat released-version.txt)
|
||||
echo "RELEASED_VERSION=$RELEASED_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Log in to DockerHub
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_SB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_SB_PASSWORD }}
|
||||
|
||||
- name: Build docker image and push
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm/v6,linux/arm64,linux/386,linux/ppc64le
|
||||
provenance: false
|
||||
tags: swaggerapi/swagger-ui:latest,swaggerapi/swagger-ui:v${{ env.RELEASED_VERSION }}
|
||||
@@ -0,0 +1,23 @@
|
||||
name: Security scan for docker image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '30 4 * * *'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run Trivy vulnerability scanner
|
||||
uses: aquasecurity/trivy-action@master
|
||||
with:
|
||||
image-ref: 'docker.swagger.io/swaggerapi/swagger-ui:unstable'
|
||||
format: 'table'
|
||||
exit-code: '1'
|
||||
ignore-unfixed: true
|
||||
vuln-type: 'os,library'
|
||||
severity: 'CRITICAL,HIGH'
|
||||
@@ -0,0 +1,86 @@
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, next ]
|
||||
pull_request:
|
||||
branches: [ master, next ]
|
||||
|
||||
env:
|
||||
CYPRESS_CACHE_FOLDER: cypress/cache
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
|
||||
- name: Cache Node Modules and Cypress binary
|
||||
uses: actions/cache@v5
|
||||
id: cache-primes
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
${{ env.CYPRESS_CACHE_FOLDER }}
|
||||
key: ${{ runner.os }}-node-and-cypress-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-primes.outputs.cache-hit != 'true'
|
||||
run: npm ci
|
||||
|
||||
- name: Lint code for errors only
|
||||
run: npm run lint-errors
|
||||
|
||||
- name: Run all tests
|
||||
run: npm run test:unit
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Build SwaggerUI
|
||||
run: npm run build
|
||||
|
||||
- name: Test build artifacts
|
||||
run: npm run test:artifact
|
||||
|
||||
e2e-tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
containers: ['+(a11y|security|bugs)/**/*cy.js', 'features/**/+(o|d)*.cy.js', 'features/**/m*.cy.js', 'features/**/!(o|d|m)*.cy.js']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
|
||||
- name: Cache Node Modules and Cypress binary
|
||||
uses: actions/cache@v5
|
||||
id: cache-primes
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
${{ env.CYPRESS_CACHE_FOLDER }}
|
||||
key: ${{ runner.os }}-node-and-cypress-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-primes.outputs.cache-hit != 'true'
|
||||
run: npm ci
|
||||
|
||||
- name: Cypress Test
|
||||
run: npx start-server-and-test cy:start http://localhost:3204 'npm run cy:run -- --spec "test/e2e-cypress/e2e/${{ matrix.containers }}"'
|
||||
@@ -0,0 +1,61 @@
|
||||
name: Release SwaggerUI Dist
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Release SwaggerUI"]
|
||||
types:
|
||||
- completed
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
release-swagger-ui-dist:
|
||||
if: github.event.workflow_run.conclusion == 'success'
|
||||
name: Release swagger-ui-dist npm package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
ref: master
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
cache-dependency-path: package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Download build artifact
|
||||
uses: actions/github-script@v9
|
||||
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 npmjs.com
|
||||
run: ./deploy.sh
|
||||
working-directory: ./swagger-ui-dist-package
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
PUBLISH_DIST: true
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
name: Release SwaggerUI to Packagist
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Release SwaggerUI"]
|
||||
types:
|
||||
- completed
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
release-swagger-ui-packagist:
|
||||
if: github.event.workflow_run.conclusion == 'success'
|
||||
name: Release swagger-ui to packagist
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update SwaggerUI packagist package
|
||||
run: |
|
||||
curl --fail -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
"https://packagist.org/api/update-package?username=${{ secrets.PACKAGIST_USER }}&apiToken=${{ secrets.PACKAGIST_API_TOKEN }}" \
|
||||
-d "{\"repository\":{\"url\":\"https://packagist.org/packages/swagger-api/swagger-ui\"}}"
|
||||
@@ -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@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
ref: master
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
cache-dependency-path: package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Download build artifact
|
||||
uses: actions/github-script@v9
|
||||
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 npmjs.com
|
||||
run: ./run.sh
|
||||
working-directory: ./flavors/swagger-ui-react/release
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
PUBLISH_FLAVOR_REACT: true
|
||||
@@ -0,0 +1,95 @@
|
||||
name: Release SwaggerUI
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release swagger-ui npm package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
ref: master
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
cache-dependency-path: package-lock.json
|
||||
|
||||
- name: Determine the next release version
|
||||
uses: cycjimmy/semantic-release-action@v6
|
||||
with:
|
||||
dry_run: true
|
||||
extra_plugins: |
|
||||
@semantic-release/git
|
||||
@semantic-release/exec
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Nothing to release
|
||||
if: ${{ env.NEXT_RELEASE_VERSION == '' }}
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('Nothing to release')
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Prepare for the Release
|
||||
env:
|
||||
REACT_APP_VERSION: ${{ env.NEXT_RELEASE_VERSION }}
|
||||
run: |
|
||||
npm run test
|
||||
npm run build
|
||||
|
||||
- name: Semantic Release
|
||||
id: semantic
|
||||
uses: cycjimmy/semantic-release-action@v6
|
||||
with:
|
||||
dry_run: false
|
||||
extra_plugins: |
|
||||
@semantic-release/git
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Release failed
|
||||
if: steps.semantic.outputs.new_release_published == 'false'
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('Release failed')
|
||||
|
||||
- name: Release published
|
||||
run: |
|
||||
echo ${{ steps.semantic.outputs.new_release_version }}
|
||||
echo ${{ steps.semantic.outputs.new_release_major_version }}
|
||||
echo ${{ steps.semantic.outputs.new_release_minor_version }}
|
||||
echo ${{ steps.semantic.outputs.new_release_patch_version }}
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: dist
|
||||
path: ./dist
|
||||
|
||||
|
||||
- name: Prepare released version for uploading
|
||||
shell: bash
|
||||
run: |
|
||||
echo ${{ steps.semantic.outputs.new_release_version }} > released-version.txt
|
||||
- name: Upload released version
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: released-version
|
||||
path: ./released-version.txt
|
||||
retention-days: 1
|
||||
Reference in New Issue
Block a user