mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 10:32:27 +08:00
refactor(ci): deduplicate server build
This commit is contained in:
parent
711ab84557
commit
6ae143cc38
25
.github/actions/build-server/action.yml
vendored
Normal file
25
.github/actions/build-server/action.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
inputs:
|
||||||
|
arch:
|
||||||
|
description: "The architecture to build for: x64, arm64"
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Set up node & dependencies
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: "npm"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
- name: Run Linux server build
|
||||||
|
env:
|
||||||
|
MATRIX_ARCH: ${{ inputs.arch }}
|
||||||
|
run: |
|
||||||
|
npm run update-build-info
|
||||||
|
./bin/build-server.sh
|
||||||
|
- name: Prepare artifacts
|
||||||
|
run: |
|
||||||
|
mkdir -p upload
|
||||||
|
file=$(find dist -name '*.tar.xz' -print -quit)
|
||||||
|
cp "$file" "upload/TriliumNextNotes-linux-${{ inputs.arch }}-${{ github.ref_name }}.tar.xz"
|
20
.github/workflows/main.yml
vendored
20
.github/workflows/main.yml
vendored
@ -67,24 +67,10 @@ jobs:
|
|||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up node & dependencies
|
- name: Run the build
|
||||||
uses: actions/setup-node@v4
|
uses: ./.github/actions/build-server
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
arch: ${{ matrix.arch }}
|
||||||
cache: "npm"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
- name: Run Linux server build
|
|
||||||
env:
|
|
||||||
MATRIX_ARCH: ${{ matrix.arch }}
|
|
||||||
run: |
|
|
||||||
npm run update-build-info
|
|
||||||
./bin/build-server.sh
|
|
||||||
- name: Prepare artifacts
|
|
||||||
run: |
|
|
||||||
mkdir -p upload
|
|
||||||
file=$(find dist -name '*.tar.xz' -print -quit)
|
|
||||||
cp "$file" "upload/TriliumNextNotes-linux-${{ matrix.arch }}-${{ github.ref_name }}.tar.xz"
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: TriliumNextNotes linux server ${{ matrix.arch }}
|
name: TriliumNextNotes linux server ${{ matrix.arch }}
|
||||||
|
22
.github/workflows/nightly.yml
vendored
22
.github/workflows/nightly.yml
vendored
@ -85,24 +85,12 @@ jobs:
|
|||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up node & dependencies
|
|
||||||
uses: actions/setup-node@v4
|
- name: Run the build
|
||||||
|
uses: ./.github/actions/build-server
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
arch: ${{ matrix.arch }}
|
||||||
cache: "npm"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
- name: Run Linux server build
|
|
||||||
env:
|
|
||||||
MATRIX_ARCH: ${{ matrix.arch }}
|
|
||||||
run: |
|
|
||||||
npm run update-build-info
|
|
||||||
./bin/build-server.sh
|
|
||||||
- name: Prepare artifacts
|
|
||||||
run: |
|
|
||||||
mkdir -p upload
|
|
||||||
file=$(find dist -name '*.tar.xz' -print -quit)
|
|
||||||
cp "$file" "upload/TriliumNextNotes-linux-${{ matrix.arch }}-${{ github.ref_name }}.tar.xz"
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: TriliumNextNotes linux server ${{ matrix.arch }}
|
name: TriliumNextNotes linux server ${{ matrix.arch }}
|
||||||
|
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@ -60,24 +60,12 @@ jobs:
|
|||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up node & dependencies
|
|
||||||
uses: actions/setup-node@v4
|
- name: Run the build
|
||||||
|
uses: ./.github/actions/build-server
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
arch: ${{ matrix.arch }}
|
||||||
cache: "npm"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
- name: Run Linux server build
|
|
||||||
env:
|
|
||||||
MATRIX_ARCH: ${{ matrix.arch }}
|
|
||||||
run: |
|
|
||||||
npm run update-build-info
|
|
||||||
./bin/build-server.sh
|
|
||||||
- name: Prepare artifacts
|
|
||||||
run: |
|
|
||||||
mkdir -p upload
|
|
||||||
file=$(find dist -name '*.tar.xz' -print -quit)
|
|
||||||
cp "$file" "upload/TriliumNextNotes-linux-${{ matrix.arch }}-${{ github.ref_name }}.tar.xz"
|
|
||||||
- name: Publish release
|
- name: Publish release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user