From 3735f680d2489e3af8e42f8438e80240138e1b8a Mon Sep 17 00:00:00 2001 From: RoyceDa Date: Wed, 18 Feb 2026 16:55:21 +0200 Subject: [PATCH] darwin workflow --- .gitea/workflows/darwin.yaml | 44 +++++++++++++++++++++++++++++++++++ .gitea/workflows/windows.yaml | 11 +++++++-- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/darwin.yaml diff --git a/.gitea/workflows/darwin.yaml b/.gitea/workflows/darwin.yaml new file mode 100644 index 0000000..b1b052e --- /dev/null +++ b/.gitea/workflows/darwin.yaml @@ -0,0 +1,44 @@ +name: MacOS Kernel Build + +#Запускаем только кнопкой "Run workflow" в Actions -> Build MacOS +on: + workflow_dispatch: + +jobs: + build: + runs-on: macos + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: '22' + # Кэш для electron-builder + - name: Cache electron-builder + uses: actions/cache@v5 + with: + path: | + ${{ env.HOME }}/Library/Caches/electron-builder + ${{ env.HOME }}/Library/Caches/electron + key: ${{ runner.os }}-electron-builder-${{ hashFiles('**/electron-builder.yml') }} + restore-keys: | + ${{ runner.os }}-electron-builder- + if-no-files-found: ignore + - name: NPM offline setup + shell: bash + run: | + npm config set cache "$HOME/.npm-cache" --global + npm config set prefer-offline true --global + - name: Install npm dependencies + run: npm install --prefer-offline --no-audit --no-fund + - name: Build the application + run: npm run kernel:mac + #Загружаем на удаленный сервер по SSH используя scp и пароль из секретов + #Загружаем из двух папок dist/builds/darwin/x64 и dist/builds/darwin/arm64, так как electron-builder может создавать разные файлы для разных архитектур + - name: Upload to SSH using scp + shell: bash + run: | + scp -o StrictHostKeyChecking=no dist/builds/darwin/arm64/Rosetta-*.pkg "${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_TARGET_DIR }}/darwin/arm64" <<< "${{ secrets.SSH_PASSWORD }}" + scp -o StrictHostKeyChecking=no dist/builds/darwin/x64/Rosetta-*.pkg "${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_TARGET_DIR }}/darwin/x64" <<< "${{ secrets.SSH_PASSWORD }}" \ No newline at end of file diff --git a/.gitea/workflows/windows.yaml b/.gitea/workflows/windows.yaml index 7b13520..89c6f7a 100644 --- a/.gitea/workflows/windows.yaml +++ b/.gitea/workflows/windows.yaml @@ -1,8 +1,15 @@ -name: Build Windows +name: Windows Kernel Build #Запускаем только кнопкой "Run workflow" в Actions -> Build Windows +#Или если есть коммпит в папку lib в ветке main on: workflow_dispatch: + push: + branches: + - main + paths: + - 'lib/**' + jobs: @@ -46,7 +53,7 @@ jobs: run: | & "$env:GITHUB_WORKSPACE\.gitea\workflows\sshupload.ps1" ` -LocalFilePath "dist/builds/win/x64/Rosetta-*.exe" ` - -RemoteFolderPath "${{ secrets.SSH_TARGET_DIR }}" ` + -RemoteFolderPath "${{ secrets.SSH_TARGET_DIR }}/win32/x64" ` -ServerAddress "${{ secrets.SSH_HOST }}" ` -Username "${{ secrets.SSH_USERNAME }}" ` -PasswordParam '${{ secrets.SSH_PASSWORD }}'