Workflow
This commit is contained in:
82
.gitea/workflows/service-packs.yaml
Normal file
82
.gitea/workflows/service-packs.yaml
Normal file
@@ -0,0 +1,82 @@
|
||||
name: SP Builds
|
||||
|
||||
#Запускаем только кнопкой "Run workflow" в Actions -> Build MacOS
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'lib/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos, ubuntu]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '22'
|
||||
# Кэш npm (тарифы грузятся из ~/.npm-cache на macOS)
|
||||
- name: Cache npm cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ env.HOME }}/.npm-cache
|
||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-npm-
|
||||
if-no-files-found: ignore
|
||||
# Кэш для electron-builder (macOS)
|
||||
- name: Cache electron-builder (macOS)
|
||||
if: matrix.os == 'macos'
|
||||
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
|
||||
|
||||
# Кэш для electron-builder (Ubuntu)
|
||||
- name: Cache electron-builder (Ubuntu)
|
||||
if: matrix.os == 'ubuntu'
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
${{ env.HOME }}/.cache/electron-builder
|
||||
${{ env.HOME }}/.cache/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:linux
|
||||
#Загружаем на удаленный сервер по SSH используя scp и пароль из секретов
|
||||
#Загружаем из двух папок dist/builds/darwin/x64 и dist/builds/darwin/arm64, так как electron-builder может создавать разные файлы для разных архитектур
|
||||
- name: Upload to SSH
|
||||
shell: bash
|
||||
run: |
|
||||
"$GITHUB_WORKSPACE/.gitea/workflows/sshupload.sh" \
|
||||
-l "$GITHUB_WORKSPACE/packs/*" \
|
||||
-r "${{ secrets.SDU_SSH_PACKS }}" \
|
||||
-s "${{ secrets.SSH_HOST }}" \
|
||||
-u "${{ secrets.SSH_USERNAME }}" \
|
||||
-p '${{ secrets.SSH_PASSWORD }}'
|
||||
Reference in New Issue
Block a user