mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Workflows
This commit is contained in:
parent
91decf00bf
commit
fdc5110da0
4 changed files with 124 additions and 18 deletions
65
.github/scripts/create_snapshot.bat
vendored
Normal file
65
.github/scripts/create_snapshot.bat
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
|
||||
rem Set Double Commander version
|
||||
set DC_VER=1.1.0
|
||||
|
||||
rem The new package will be created from here
|
||||
set BUILD_PACK_DIR=%TEMP%\doublecmd-release
|
||||
|
||||
rem The new package will be saved here
|
||||
set PACK_DIR=%CD%\doublecmd-release
|
||||
|
||||
rem Prepare target dir
|
||||
mkdir %PACK_DIR%
|
||||
|
||||
rem Get revision number
|
||||
call src\platform\git2revisioninc.exe.cmd %CD%
|
||||
echo %REVISION%> %PACK_DIR%\revision.txt
|
||||
|
||||
rem Change log
|
||||
git log -n 10 --format="%%h %%al %%ai%%n%%s%%n" > %PACK_DIR%\changelog.txt
|
||||
|
||||
rem Get libraries
|
||||
pushd install
|
||||
curl -o windows.7z -L https://github.com/doublecmd/snapshots/raw/main/windows.7z
|
||||
"%ProgramFiles%\7-Zip\7z.exe" x windows.7z
|
||||
del /Q windows.7z
|
||||
popd
|
||||
|
||||
rem Set processor architecture
|
||||
set CPU_TARGET=i386
|
||||
set OS_TARGET=win32
|
||||
|
||||
call :doublecmd
|
||||
|
||||
rem Set processor architecture
|
||||
set CPU_TARGET=x86_64
|
||||
set OS_TARGET=win64
|
||||
|
||||
call :doublecmd
|
||||
|
||||
GOTO:EOF
|
||||
|
||||
:doublecmd
|
||||
rem Build all components of Double Commander
|
||||
call build.bat darkwin
|
||||
|
||||
rem Copy libraries
|
||||
copy install\windows\lib\%CPU_TARGET%\*.dll %CD%\
|
||||
copy install\windows\lib\%CPU_TARGET%\winpty-agent.exe %CD%\
|
||||
|
||||
rem Prepare install dir
|
||||
mkdir %BUILD_PACK_DIR%
|
||||
|
||||
rem Prepare install files
|
||||
call install\windows\install.bat
|
||||
|
||||
rem Create *.7z archive
|
||||
"%ProgramFiles%\7-Zip\7z.exe" a -mx9 %PACK_DIR%\doublecmd-%DC_VER%.r%REVISION%.%CPU_TARGET%-%OS_TARGET%.7z %DC_INSTALL_DIR%\*
|
||||
|
||||
rem Clean
|
||||
del /Q *.dll
|
||||
del /Q *.exe
|
||||
call clean.bat
|
||||
rm -rf %BUILD_PACK_DIR%
|
||||
|
||||
GOTO:EOF
|
||||
2
.github/scripts/create_snapshot.sh
vendored
2
.github/scripts/create_snapshot.sh
vendored
|
|
@ -4,7 +4,7 @@
|
|||
DC_VER=1.1.0
|
||||
|
||||
# The new package will be saved here
|
||||
PACK_DIR=/var/tmp/doublecmd-release
|
||||
PACK_DIR=$PWD/doublecmd-release
|
||||
|
||||
# Temp dir for creating *.dmg package
|
||||
BUILD_PACK_DIR=/var/tmp/doublecmd-$(date +%y.%m.%d)
|
||||
|
|
|
|||
39
.github/scripts/upload_snapshot.sh
vendored
39
.github/scripts/upload_snapshot.sh
vendored
|
|
@ -1,11 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "$SSH_PRIVATE_KEY" > ssh_key && chmod 0600 ssh_key
|
||||
sftp -o StrictHostKeyChecking=no -i ssh_key $REMOTE_USER@$REMOTE_HOST <<END
|
||||
cd /home/project-web/doublecmd/htdocs/snapshots
|
||||
lcd /var/tmp/doublecmd-release
|
||||
rm *.dmg
|
||||
put *.dmg
|
||||
put *.php
|
||||
quit
|
||||
END
|
||||
echo $OSTYPE
|
||||
|
||||
echo "$SSH_PRIVATE_KEY" > ssh_key
|
||||
|
||||
echo "cd /home/project-web/doublecmd/htdocs/snapshots" > upload_snapshot.txt
|
||||
echo "lcd doublecmd-release" >> upload_snapshot.txt
|
||||
|
||||
if [[ "$OSTYPE" == "msys" ]]; then
|
||||
|
||||
icacls.exe ssh_key //inheritance:r
|
||||
|
||||
echo "rm *.7z" >> upload_snapshot.txt
|
||||
echo "put *.7z" >> upload_snapshot.txt
|
||||
echo "put *.txt" >> upload_snapshot.txt
|
||||
|
||||
else
|
||||
|
||||
chmod 0600 ssh_key
|
||||
|
||||
echo "rm *.dmg" >> upload_snapshot.txt
|
||||
echo "put *.dmg" >> upload_snapshot.txt
|
||||
echo "put *.php" >> upload_snapshot.txt
|
||||
|
||||
fi
|
||||
|
||||
echo "quit" >> upload_snapshot.txt
|
||||
|
||||
sftp -o StrictHostKeyChecking=no -i ssh_key -b upload_snapshot.txt $REMOTE_USER@$REMOTE_HOST
|
||||
|
||||
rm -f ssh_key upload_snapshot.txt
|
||||
|
|
|
|||
36
.github/workflows/snapshots.yml
vendored
36
.github/workflows/snapshots.yml
vendored
|
|
@ -6,7 +6,7 @@ on:
|
|||
- 'components/**'
|
||||
- 'plugins/**'
|
||||
- 'sdk/**'
|
||||
- 'src/**'
|
||||
- 'src/**'
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
@ -15,17 +15,13 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [macos-11]
|
||||
lazarus-versions: [stable]
|
||||
build-mac:
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- name: Install Free Pascal
|
||||
uses: alexx2000/setup-fpc@master
|
||||
with:
|
||||
lazarus-version: ${{ matrix.lazarus-versions }}
|
||||
lazarus-version: "stable"
|
||||
|
||||
- name: Get Lazarus source
|
||||
uses: actions/checkout@v3
|
||||
|
|
@ -55,3 +51,27 @@ jobs:
|
|||
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
|
||||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
||||
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
||||
|
||||
build-win:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Install Lazarus
|
||||
uses: alexx2000/setup-fpc@win
|
||||
with:
|
||||
lazarus-version: "2.2.6"
|
||||
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build packages
|
||||
run: ./.github/scripts/create_snapshot.bat
|
||||
|
||||
- name: Deploy to snapshot server
|
||||
run: ./.github/scripts/upload_snapshot.sh
|
||||
shell: bash
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
|
||||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
||||
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue