Skip to content

Commit ed2a66b

Browse files
sort zipping by remove -j and working dir. Publish page from html instead of jekyll.
1 parent 967bb5a commit ed2a66b

File tree

5 files changed

+72
-8
lines changed

5 files changed

+72
-8
lines changed

.github/actions/build-docs/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ runs:
3434
#run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
3535
env:
3636
JEKYLL_ENV: production
37+
3738
- name: Upload artifact
3839
# Automatically uploads an artifact from the './_site' directory by default
3940
uses: actions/upload-pages-artifact@v3

.github/actions/build-sdk/action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ runs:
2323
shell: bash
2424
run: mkdir typescript
2525

26+
- name: make html folder
27+
working-directory: ./html
28+
shell: bash
29+
run: mkdir html
30+
2631
- name: make python folder
2732
working-directory: ./sdk
2833
shell: bash
@@ -33,6 +38,12 @@ runs:
3338
shell: bash
3439
run: make build
3540

41+
- name: Upload html artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
path: "sdk/html"
45+
name: sdk-html-${{ inputs.version }}
46+
3647
- name: Upload ts artifact
3748
uses: actions/upload-artifact@v4
3849
with:
@@ -44,3 +55,16 @@ runs:
4455
with:
4556
path: "sdk/python"
4657
name: sdk-python-${{ inputs.version }}
58+
59+
# - name: Upload artifact
60+
# # Automatically uploads an artifact from the './_site' directory by default
61+
# uses: actions/upload-pages-artifact@v3
62+
# with:
63+
# path: "docs/_site/"
64+
# name: jekyll-docs-${{ inputs.version }}
65+
66+
- name: Upload artifact
67+
uses: actions/upload-pages-artifact@v3
68+
with:
69+
path: "sdk/html/"
70+
name: sdk-html-docs-${{ inputs.version }}

.github/workflows/cicd-3-deploy.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,37 @@ jobs:
102102
env:
103103
GH_TOKEN: ${{ github.token }}
104104
run: |
105-
gh release download ${{steps.get-asset-version.outputs.release_version}} -p jekyll-docs-*.tar --output artifact.tar
105+
gh release download ${{steps.get-asset-version.outputs.release_version}} -p sdk-html-docs-*.tar --output artifact.tar
106106
107107
- uses: actions/upload-artifact@v4
108108
with:
109-
name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}
109+
name: sdk-html-docs-${{steps.get-asset-version.outputs.release_version}}
110110
path: artifact.tar
111111

112112
- name: Deploy to GitHub Pages
113113
id: deployment
114114
uses: actions/deploy-pages@v4
115115
with:
116-
artifact_name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}
116+
artifact_name: sdk-html-docs-${{steps.get-asset-version.outputs.release_version}}
117+
118+
119+
### BELOW WAS THE DEFAULT USING THE JEKYLL BUILD
120+
121+
# - name: "Get release version"
122+
# id: download-asset
123+
# shell: bash
124+
# env:
125+
# GH_TOKEN: ${{ github.token }}
126+
# run: |
127+
# gh release download ${{steps.get-asset-version.outputs.release_version}} -p jekyll-docs-*.tar --output artifact.tar
128+
129+
# - uses: actions/upload-artifact@v4
130+
# with:
131+
# name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}
132+
# path: artifact.tar
133+
134+
# - name: Deploy to GitHub Pages
135+
# id: deployment
136+
# uses: actions/deploy-pages@v4
137+
# with:
138+
# artifact_name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}

.github/workflows/stage-5-publish.yaml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,26 @@ jobs:
7878
# run: zip jekyll-docs-${{ inputs.version }}.zip ./artifact.tar
7979
# shell: bash
8080

81+
- name: "zip html release asset"
82+
# Git hub pages needs a single tar called artifact inside the zip.
83+
working-directory: ./artifacts/sdk-html-${{ inputs.version }}
84+
run: zip -r sdk-html-${{ inputs.version }}.zip .
85+
shell: bash
86+
87+
- name: "Upload sdk html release asset"
88+
uses: actions/upload-release-asset@v1
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
with:
92+
upload_url: "${{ steps.create_release.outputs.upload_url }}"
93+
asset_path: ./artifacts/sdk-html-${{ inputs.version }}.zip
94+
asset_name: sdk-html-${{ inputs.version }}.zip
95+
asset_content_type: "application/gzip"
96+
8197
- name: "zip sdk ts release asset"
8298
# Git hub pages needs a single tar called artifact inside the zip.
83-
working-directory: ./artifacts
84-
run: zip -r -j sdk-ts-${{ inputs.version }}.zip ./sdk-ts-${{ inputs.version }}
99+
working-directory: ./artifacts/sdk-ts-${{ inputs.version }}
100+
run: zip -r sdk-ts-${{ inputs.version }}.zip .
85101
shell: bash
86102

87103
- name: "Upload sdk ts release asset"
@@ -96,8 +112,8 @@ jobs:
96112

97113
- name: "zip sdk python release asset"
98114
# Git hub pages needs a single tar called artifact inside the zip.
99-
working-directory: ./artifacts
100-
run: zip -r -j sdk-python-${{ inputs.version }}.zip ./sdk-python-${{ inputs.version }}
115+
working-directory: ./artifacts/sdk-python-${{ inputs.version }}
116+
run: zip -r sdk-python-${{ inputs.version }}.zip .
101117
shell: bash
102118

103119
- name: "Upload sdk python release asset"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@
4343
},
4444
"scripts": {
4545
"build": "npm run generate",
46-
"generate": "npm run generate:ts && npm run generate:python",
46+
"generate": "npm run generate:html && npm run generate:ts && npm run generate:python",
4747
"generate-dependencies": "npm run generate-dependencies --workspaces --if-present",
48+
"generate:html": "docker run --rm --user $(id -u) -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/specification/api/notify-supplier.yml -g html -o /local/sdk/html --skip-validate-spec",
4849
"generate:python": "docker run --rm --user $(id -u) -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/specification/api/notify-supplier.yml -g python -o /local/sdk/python --skip-validate-spec",
4950
"generate:ts": "docker run --rm --user $(id -u) -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/specification/api/notify-supplier.yml -g typescript -o /local/sdk/typescript --skip-validate-spec",
5051
"lint": "npm run lint --workspaces",

0 commit comments

Comments
 (0)