Skip to content

Commit

Permalink
Improved release files size
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohamedin committed Dec 31, 2023
1 parent c64aa51 commit cfb144b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/electron-builder-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,31 @@ jobs:
- name: Checkout reposistory
uses: actions/checkout@v4
with:
submodules: false
- name: Remove drawio submodule
shell: powershell #The default shell for Windows
run: |
Remove-Item '.gitmodules'
Remove-Item 'drawio' -Recurse
md drawio
submodules: true
- name: Checkout drawio-dev
uses: actions/checkout@v4
with:
repository: jgraph/drawio-dev
token: ${{ secrets.GH_TOKEN }}
ref: release
path: drawio
path: drawio-dev
submodules: false
- name: Get drawio Tag & Submodules
run: |
cd drawio
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
# Get submodules of draw.io
git config --global --add safe.directory '*'
git submodule init
git config submodule.src/main/webapp/resources.url https://${{secrets.I18N_USERNAME}}:${{secrets.I18N_ACCESS_KEY}}@github.com/jgraph/drawio-i18n.git
git submodule update --init --recursive
Copy-Item -Path "src\main\webapp\js\*.min.js" -Destination "..\drawio\src\main\webapp\js\"
cd ..
Remove-Item 'drawio-dev' -Recurse -Force
- name: Installing Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- name: Prepare for Windows Build
shell: powershell #The default shell for Windows
run: |
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,31 @@ jobs:
- name: Checkout reposistory
uses: actions/checkout@v4
with:
submodules: false
- name: Remove drawio submodule
run: |
rm .gitmodules
rm -rf drawio
mkdir drawio
submodules: true
- name: Checkout drawio-dev
uses: actions/checkout@v4
with:
repository: jgraph/drawio-dev
token: ${{ secrets.GH_TOKEN }}
ref: release
path: drawio
path: drawio-dev
submodules: false
- name: Get drawio Tag & Submodules
run: |
cd drawio
cd drawio-dev
# Get the current build tag from draw.io
export tmp1=${GH_REF/refs\//}
export tmp2=${tmp1/\/v/\/diagramly-}
export tmp3=${tmp2//\./_}
git fetch origin refs/$tmp3:refs/$tmp3 --no-tags
git checkout $tmp3 -b tmp-deploy
# Get submodules of draw.io
git config --global --add safe.directory '*'
git submodule init
git config submodule.src/main/webapp/resources.url https://${{secrets.I18N_USERNAME}}:${{secrets.I18N_ACCESS_KEY}}@github.com/jgraph/drawio-i18n.git
git submodule update --init --recursive
cp src/main/webapp/js/*.min.js ../drawio/src/main/webapp/js/
cd ..
rm -rf drawio-dev
- name: Installing Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
- name: Build for ${{ matrix.os}}
run: |
if [ "$OS_NAME" = "ubuntu-latest" ]; then sudo apt-get update && sudo apt-get install -y icnsutils graphicsmagick xz-utils rpm; fi
Expand Down

1 comment on commit cfb144b

@davidjgraph
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Binary was bloated by unnecessary files.

Please sign in to comment.