Official electron build of diagrams.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

102 lines
3.5 KiB

name: Electron Builder CI (WIN)
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REF: ${{ github.ref }}
steps:
- name: Checkout reposistory
uses: actions/checkout@v4
with:
submodules: true
- name: Checkout drawio-dev
uses: actions/checkout@v4
with:
repository: jgraph/drawio-dev
token: ${{ secrets.GH_TOKEN }}
ref: release
path: drawio-dev
submodules: false
- name: Get drawio Tag & Submodules
run: |
cd drawio-dev
# Get the current build tag from draw.io
$tmp=$Env:GH_REF -replace '/v','/diagramly-' -replace '[.]','_'
$ref=$tmp+':'+$tmp
git fetch origin $ref --no-tags
$tmp=$tmp -replace 'refs/',''
git checkout $tmp -b tmp-deploy
Copy-Item -Path "src\main\webapp\js\*.min.js" -Destination "..\drawio\src\main\webapp\js\"
cd ..
Remove-Item 'drawio-dev' -Recurse -Force
cd drawio
Remove-Item 'docs','etc','src\main\java','src\main\webapp\connect','src\main\webapp\service-worker*','src\main\webapp\workbox-*' -Recurse -Force
cd src\main\webapp\js
Remove-Item 'atlas-viewer.min.js','atlas.min.js','cryptojs','deflate','dropbox','embed*','freehand','integrate.min.js','jquery','jszip','mermaid','onedrive','orgchart','reader.min.js','rough','sanitizer','shapes.min.js','simplepeer','spin','viewer-static.min.js','viewer.min.js' -Recurse -Force
- name: Installing Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Prepare for Windows Build
shell: powershell #The default shell for Windows
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
npm install -g yarn
yarn install
- name: Build for Windows (x32 & arm64)
env:
CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
shell: powershell #The default shell for Windows
run: |
#Disable auto-update and build 32bit/arm64 first such that latest.yml is for 64bit only (64bit will overwrite 32bit one)
yarn run sync disableUpdate
yarn run release-win32
yarn run release-win-arm64
- name: Build for Windows (x64)
env:
CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
shell: powershell #The default shell for Windows
run: |
#Enable auto-update again
yarn run sync
yarn run release-win
- name: Build unpacked Windows x64 (for zip portable)
shell: powershell
run: |
yarn run sync disableUpdate
yarn run electron-builder --win --x64 --dir
- name: Zip unpacked x64 build
shell: powershell
run: |
$version = "${{ github.ref }}" -replace 'refs/tags/v', ''
cd dist
7z a "draw.io-$version-windows.zip" ".\win-unpacked\*"
- name: Build for Windows (APPX)
shell: powershell #The default shell for Windows
run: |
#Disable auto-update for appx also
yarn run sync disableUpdate
yarn run release-appx
- name: Install GitHub CLI
uses: cli/cli-action@v1
- name: Upload portable zip to GitHub Release
shell: powershell
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$version = "${{ github.ref }}" -replace 'refs/tags/v', ''
gh release upload "v$version" "dist/draw.io-$version-windows.zip" --clobber