swagger-ui-electron #723
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: swagger-ui-electron | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * *' | |
push: | |
branches: | |
- main | |
- master | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: check_verion | |
run: | | |
curl https://registry.npmjs.org/swagger-ui-dist/latest > npm.json | |
curl https://api.github.com/repos/ke4nec/swagger-ui-electron/releases/latest > github.json | |
node sync.js | |
if [ $? == 1 ]; then exit 0; fi | |
build: | |
needs: check | |
runs-on: ubuntu-latest | |
container: | |
image: electronuserland/builder:wine | |
outputs: | |
ver: ${{ steps.prepare.outputs.ver }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: prepare | |
id: prepare | |
run: | | |
curl https://registry.npmjs.org/swagger-ui-dist/latest > npm.json | |
curl https://api.github.com/repos/ke4nec/swagger-ui-electron/releases/latest > github.json | |
node sync.js | |
if [ $? == 1 ]; then exit 0; fi | |
export VER=$(cat ver.txt) | |
echo "::set-output name=ver::$VER" | |
apt-get update && apt-get install -y zip && chown root:root /github/home | |
- run: | | |
npm i swagger-ui-dist@latest | |
npm i | |
npm run make-all | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: out/make/zip/ | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ needs.build.outputs.ver }} | |
release_name: swagger-ui-electron-v${{ needs.build.outputs.ver }} | |
draft: false | |
prerelease: false | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifacts | |
- name: Upload Macos Release Asset | |
if: steps.create_release.outputs.upload_url | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./darwin/x64/swagger-ui-electron-darwin-x64-1.0.0.zip | |
asset_name: swagger-ui-electron-darwin-x64-${{ needs.build.outputs.ver }}.zip | |
asset_content_type: application/zip | |
- name: Upload Linux Release Asset | |
if: steps.create_release.outputs.upload_url | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./linux/x64/swagger-ui-electron-linux-x64-1.0.0.zip | |
asset_name: swagger-ui-electron-linux-x64-${{ needs.build.outputs.ver }}.zip | |
asset_content_type: application/zip | |
- name: Upload Windows Release Asset | |
if: steps.create_release.outputs.upload_url | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./win32/x64/swagger-ui-electron-win32-x64-1.0.0.zip | |
asset_name: swagger-ui-electron-win32-x64-${{ needs.build.outputs.ver }}.zip | |
asset_content_type: application/zip | |