Skip to content

Commit

Permalink
Changed build GitHub action to use drawio-dev repo
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohamedin committed Dec 21, 2023
1 parent 127c8fc commit a63a70f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 8 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/electron-builder-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,47 @@ jobs:
runs-on: windows-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REF: ${{ github.ref }}
steps:
- name: Checkout reposistory
uses: actions/checkout@v3
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
- name: Checkout drawio-dev
uses: actions/checkout@v4
with:
repository: jgraph/drawio-dev
token: ${{ secrets.GH_TOKEN }}
ref: release
path: drawio
submodules: false
- name: Get drawio Tag & Submodules
run: |
cd drawio
# 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
- name: Installing Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Prepare for Windows Build
shell: powershell #The default shell for Windows
run: |
git config --global core.autocrlf input
(gc .\.gitmodules) -replace '[email protected]:','https://github.com/' | Out-File -encoding ASCII .gitmodules
git submodule update --init --recursive
npm install -g yarn
yarn install
- name: Build for Windows (x32)
Expand Down
35 changes: 31 additions & 4 deletions .github/workflows/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,39 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_TOKEN }}
OS_NAME: ${{ matrix.os }}
GH_REF: ${{ github.ref }}
steps:
- name: Checkout reposistory
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
- name: Remove drawio submodule
run: |
rm .gitmodules
rm -rf drawio
mkdir drawio
- name: Checkout drawio-dev
uses: actions/checkout@v4
with:
repository: jgraph/drawio-dev
token: ${{ secrets.GH_TOKEN }}
ref: release
path: drawio
submodules: false
- name: Get drawio Tag & Submodules
run: |
cd drawio
# 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
- name: Installing Node
uses: actions/setup-node@v3
with:
Expand All @@ -35,9 +65,6 @@ jobs:
if [ "$OS_NAME" = "ubuntu-latest" ]; then sudo apt-get update && sudo apt-get install -y icnsutils graphicsmagick xz-utils rpm; fi
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$PATH"
# Use sed to replace the SSH URL with the public URL, then initialize submodules
sed -ie 's/[email protected]:/https:\/\/github.com\//' .gitmodules
git submodule update --init --recursive
sudo npm install -g yarn
yarn install
if [ "$OS_NAME" = "ubuntu-latest" ]; then sed -ie 's/"asar": true,/"asar": true,\n"productName": "drawio",/' electron-builder-linux-mac.json; fi
Expand Down

1 comment on commit a63a70f

@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.

Please sign in to comment.