-
Notifications
You must be signed in to change notification settings - Fork 9.3k
61 lines (55 loc) · 1.83 KB
/
release-swagger-ui-react.yml
File metadata and controls
61 lines (55 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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