From 688b5317c1b338a858e8769a4c6679a630992ecc Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:43:26 +0200 Subject: [PATCH 01/10] refactor(ci): deduplicate dmg init --- .github/workflows/main.yml | 7 ++++--- .github/workflows/nightly.yml | 7 ++++--- .github/workflows/release.yml | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b20762de..2baa62f0a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,9 +37,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - name: Set up Python for appdmg to be installed - if: ${{ matrix.os.name == 'macos' }} - run: brew install python-setuptools + - name: Run the build + uses: ./.github/actions/build + with: + os: ${{ matrix.os.name }} - name: Install dependencies run: npm ci - name: Update build info diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2378d9f46..df885261b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -34,9 +34,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - name: Set up Python for appdmg to be installed - if: ${{ matrix.os.name == 'macos' }} - run: brew install python-setuptools + - name: Run the build + uses: ./.github/actions/build + with: + os: ${{ matrix.os.name }} - name: Install dependencies run: npm ci - name: Update build info diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ea938236..25e724e4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,9 +34,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - name: Set up Python for appdmg to be installed - if: ${{ matrix.os.name == 'macos' }} - run: brew install python-setuptools + - name: Run the build + uses: ./.github/actions/build + with: + os: ${{ matrix.os.name }} - name: Install dependencies run: npm ci - name: Update build info From f9082fa812242170fccb6c43394050cbba3d7895 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:47:09 +0200 Subject: [PATCH 02/10] refactor(ci): deduplicate installing dependencies & updating build --- .github/workflows/main.yml | 6 +----- .github/workflows/nightly.yml | 6 +----- .github/workflows/release.yml | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2baa62f0a..781845df6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,11 +40,7 @@ jobs: - name: Run the build uses: ./.github/actions/build with: - os: ${{ matrix.os.name }} - - name: Install dependencies - run: npm ci - - name: Update build info - run: npm run update-build-info + os: ${{ matrix.os.name }} - name: Run electron-forge run: npm run make-electron -- --arch=${{ matrix.arch }} - name: Prepare artifacts (Unix) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index df885261b..19112040c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -37,11 +37,7 @@ jobs: - name: Run the build uses: ./.github/actions/build with: - os: ${{ matrix.os.name }} - - name: Install dependencies - run: npm ci - - name: Update build info - run: npm run update-build-info + os: ${{ matrix.os.name }} - name: Update nightly version run: npm run ci-update-nightly-version - name: Run electron-forge diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25e724e4a..c7fa7b834 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,11 +37,7 @@ jobs: - name: Run the build uses: ./.github/actions/build with: - os: ${{ matrix.os.name }} - - name: Install dependencies - run: npm ci - - name: Update build info - run: npm run update-build-info + os: ${{ matrix.os.name }} - name: Run electron-forge run: npm run make-electron -- --arch=${{ matrix.arch }} - name: Prepare artifacts (Unix) From bfdb69292c7ee9228a5b355d071e3f90d2dbc0e1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:49:50 +0200 Subject: [PATCH 03/10] refactor(ci): deduplicate electron-forge --- .github/workflows/main.yml | 5 ++--- .github/workflows/nightly.yml | 7 +++---- .github/workflows/release.yml | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 781845df6..362f3d1b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,13 +36,12 @@ jobs: - name: Set up node & dependencies uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 20 - name: Run the build uses: ./.github/actions/build with: os: ${{ matrix.os.name }} - - name: Run electron-forge - run: npm run make-electron -- --arch=${{ matrix.arch }} + arch: ${{ matrix.arch }} - name: Prepare artifacts (Unix) if: runner.os != 'windows' run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 19112040c..2e14884f3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -34,14 +34,13 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 + - name: Update nightly version + run: npm run ci-update-nightly-version - name: Run the build uses: ./.github/actions/build with: os: ${{ matrix.os.name }} - - name: Update nightly version - run: npm run ci-update-nightly-version - - name: Run electron-forge - run: npm run make-electron -- --arch=${{ matrix.arch }} + arch: ${{ matrix.arch }} - name: Prepare artifacts (Unix) if: runner.os != 'windows' run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c7fa7b834..5f2e82e14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,9 +37,8 @@ jobs: - name: Run the build uses: ./.github/actions/build with: - os: ${{ matrix.os.name }} - - name: Run electron-forge - run: npm run make-electron -- --arch=${{ matrix.arch }} + os: ${{ matrix.os.name }} + arch: ${{ matrix.arch }} - name: Prepare artifacts (Unix) if: runner.os != 'windows' run: | From 836bbba7feca3eb29a4792f27a7b3dfd31f53f7a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:55:46 +0200 Subject: [PATCH 04/10] refactor(ci): deduplicate preparing artifacts --- .github/workflows/main.yml | 17 +---------------- .github/workflows/nightly.yml | 17 +---------------- .github/workflows/release.yml | 19 ++----------------- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 362f3d1b4..8610346aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,22 +42,7 @@ jobs: with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} - - name: Prepare artifacts (Unix) - if: runner.os != 'windows' - run: | - mkdir -p upload - file=$(find out/make -name '*.zip' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.zip" - file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.${{ matrix.os.extension }}" - - name: Prepare artifacts (Windows) - if: runner.os == 'windows' - run: | - mkdir upload - $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.zip" - $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.${{ matrix.os.extension }}" + extension: ${{ matrix.os.extension }} - name: Publish artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2e14884f3..81c21aefa 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -41,22 +41,7 @@ jobs: with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} - - name: Prepare artifacts (Unix) - if: runner.os != 'windows' - run: | - mkdir -p upload - file=$(find out/make -name '*.zip' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.zip" - file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}" - - name: Prepare artifacts (Windows) - if: runner.os == 'windows' - run: | - mkdir upload - $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.zip" - $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}" + extension: ${{ matrix.os.extension }} - name: Publish artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f2e82e14..aba519fcd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,23 +38,8 @@ jobs: uses: ./.github/actions/build with: os: ${{ matrix.os.name }} - arch: ${{ matrix.arch }} - - name: Prepare artifacts (Unix) - if: runner.os != 'windows' - run: | - mkdir -p upload - file=$(find out/make -name '*.zip' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ matrix.os.name }}-${{ matrix.arch }}.zip" - file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}" - - name: Prepare artifacts (Windows) - if: runner.os == 'windows' - run: | - mkdir upload - $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ matrix.os.name }}-${{ matrix.arch }}.zip" - $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}" + arch: ${{ matrix.arch }} + extension: ${{ matrix.os.extension }} - name: Publish release uses: softprops/action-gh-release@v2 with: From ddb42bfe889432ef72ccda33d8dcc1a2ac5a62c0 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 21:02:27 +0200 Subject: [PATCH 05/10] fix(ci): add missing file --- .github/actions/build-electron/action.yml | 38 +++++++++++++++++++++++ .github/workflows/main.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/release.yml | 2 +- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 .github/actions/build-electron/action.yml diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml new file mode 100644 index 000000000..007082a83 --- /dev/null +++ b/.github/actions/build-electron/action.yml @@ -0,0 +1,38 @@ +inputs: + os: + description: "One of the supported platforms: macos, linux, windows" + required: true + arch: + description: "The architecture to build for: x64, arm64" + required: true + extension: + description: "Platform specific extension to build: dmg, deb, exe" + required: true +runs: + using: composite + steps: + - name: Set up Python for appdmg to be installed + if: ${{ inputs.os == 'macos' }} + run: brew install python-setuptools + - name: Install dependencies + run: npm ci + - name: Update build info + run: npm run update-build-info + - name: Run electron-forge + run: npm run make-electron -- --arch=${{ inputs.arch }} + - name: Prepare artifacts (Unix) + if: inputs.os != 'windows' + run: | + mkdir -p upload + file=$(find out/make -name '*.zip' -print -quit) + cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" + file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) + cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" + - name: Prepare artifacts (Windows) + if: inputs.os == 'windows' + run: | + mkdir upload + $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 + Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" + $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 + Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8610346aa..7db377eee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: with: node-version: 20 - name: Run the build - uses: ./.github/actions/build + uses: ./.github/actions/build-electron with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 81c21aefa..7cf038607 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -37,7 +37,7 @@ jobs: - name: Update nightly version run: npm run ci-update-nightly-version - name: Run the build - uses: ./.github/actions/build + uses: ./.github/actions/build-electron with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aba519fcd..86b424ee4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: with: node-version: 20 - name: Run the build - uses: ./.github/actions/build + uses: ./.github/actions/build-electron with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} From cfdb561bf6653f34adfaef64d237bf53a5b09576 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 21:09:04 +0200 Subject: [PATCH 06/10] fix(ci): required shell --- .github/actions/build-electron/action.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 007082a83..f9dd2ffa5 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -13,26 +13,22 @@ runs: steps: - name: Set up Python for appdmg to be installed if: ${{ inputs.os == 'macos' }} + shell: bash run: brew install python-setuptools - name: Install dependencies + shell: bash run: npm ci - name: Update build info + shell: bash run: npm run update-build-info - name: Run electron-forge + shell: bash run: npm run make-electron -- --arch=${{ inputs.arch }} - - name: Prepare artifacts (Unix) - if: inputs.os != 'windows' + - name: Prepare artifacts + shell: bash run: | mkdir -p upload file=$(find out/make -name '*.zip' -print -quit) cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" - - name: Prepare artifacts (Windows) - if: inputs.os == 'windows' - run: | - mkdir upload - $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" - $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" \ No newline at end of file + cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" \ No newline at end of file From 711ab845577e60a1b8797ea25c3ff4b29262c12b Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 00:49:06 +0200 Subject: [PATCH 07/10] chore(editorconfig): add config for yaml files --- .editorconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.editorconfig b/.editorconfig index 2ec3ed9fa..c0aba9b74 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,3 +15,9 @@ indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true + +[*.yml] +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file From 6ae143cc38d7fa8031642fbfc0ec3bdeeeecf2db Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 4 Feb 2025 21:49:10 +0200 Subject: [PATCH 08/10] refactor(ci): deduplicate server build --- .github/actions/build-server/action.yml | 25 +++++++++++++++++++++ .github/workflows/main.yml | 28 ++++++----------------- .github/workflows/nightly.yml | 28 +++++++---------------- .github/workflows/release.yml | 30 ++++++++----------------- 4 files changed, 49 insertions(+), 62 deletions(-) create mode 100644 .github/actions/build-server/action.yml diff --git a/.github/actions/build-server/action.yml b/.github/actions/build-server/action.yml new file mode 100644 index 000000000..685222057 --- /dev/null +++ b/.github/actions/build-server/action.yml @@ -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" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7db377eee..0a852bcd4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: paths-ignore: - "docs/**" - ".github/workflows/main-docker.yml" - workflow_dispatch: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -36,13 +36,13 @@ jobs: - name: Set up node & dependencies uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 20 - name: Run the build uses: ./.github/actions/build-electron with: - os: ${{ matrix.os.name }} + os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} - extension: ${{ matrix.os.extension }} + extension: ${{ matrix.os.extension }} - name: Publish artifacts uses: actions/upload-artifact@v4 with: @@ -67,24 +67,10 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@v4 - - name: Set up node & dependencies - uses: actions/setup-node@v4 + - name: Run the build + uses: ./.github/actions/build-server with: - node-version: 20 - 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" + arch: ${{ matrix.arch }} - uses: actions/upload-artifact@v4 with: name: TriliumNextNotes linux server ${{ matrix.arch }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7cf038607..5021d6f66 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,7 +12,7 @@ permissions: contents: write jobs: nightly-electron: - name: Deploy nightly + name: Deploy nightly strategy: fail-fast: false matrix: @@ -27,7 +27,7 @@ jobs: - name: windows image: windows-latest extension: exe - runs-on: ${{ matrix.os.image }} + runs-on: ${{ matrix.os.image }} steps: - uses: actions/checkout@v4 - name: Set up node & dependencies @@ -39,7 +39,7 @@ jobs: - name: Run the build uses: ./.github/actions/build-electron with: - os: ${{ matrix.os.name }} + os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} extension: ${{ matrix.os.extension }} - name: Publish artifacts @@ -85,24 +85,12 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@v4 - - name: Set up node & dependencies - uses: actions/setup-node@v4 + + - name: Run the build + uses: ./.github/actions/build-server with: - node-version: 20 - 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" + arch: ${{ matrix.arch }} + - uses: actions/upload-artifact@v4 with: name: TriliumNextNotes linux server ${{ matrix.arch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86b424ee4..06aefbefb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ on: push: tags: - "v*" - workflow_dispatch: + workflow_dispatch: permissions: contents: write concurrency: @@ -37,8 +37,8 @@ jobs: - name: Run the build uses: ./.github/actions/build-electron with: - os: ${{ matrix.os.name }} - arch: ${{ matrix.arch }} + os: ${{ matrix.os.name }} + arch: ${{ matrix.arch }} extension: ${{ matrix.os.extension }} - name: Publish release uses: softprops/action-gh-release@v2 @@ -60,27 +60,15 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@v4 - - name: Set up node & dependencies - uses: actions/setup-node@v4 + + - name: Run the build + uses: ./.github/actions/build-server with: - node-version: 20 - 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" + arch: ${{ matrix.arch }} + - name: Publish release uses: softprops/action-gh-release@v2 with: draft: true fail_on_unmatched_files: true - files: upload/*.* \ No newline at end of file + files: upload/*.* From 0dfd01858b4ed6ff7c74e62be27da238816910b9 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 4 Feb 2025 21:50:42 +0200 Subject: [PATCH 09/10] fix(ci): remove unnecessary artifact upload --- .github/workflows/nightly.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5021d6f66..e3d98817c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -42,18 +42,6 @@ jobs: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} extension: ${{ matrix.os.extension }} - - name: Publish artifacts - uses: actions/upload-artifact@v4 - with: - name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }} - path: upload/*.zip - overwrite: true - - name: Publish installer artifacts - uses: actions/upload-artifact@v4 - with: - name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }} - path: upload/*.${{ matrix.os.extension }} - overwrite: true - name: Deploy release uses: WebFreak001/deploy-nightly@v3.2.0 @@ -63,6 +51,7 @@ jobs: asset_path: upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.zip # path to archive to upload asset_name: TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-nightly.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash asset_content_type: application/zip # required by GitHub API + - name: Deploy installer release uses: WebFreak001/deploy-nightly@v3.2.0 with: @@ -91,11 +80,6 @@ jobs: with: arch: ${{ matrix.arch }} - - uses: actions/upload-artifact@v4 - with: - name: TriliumNextNotes linux server ${{ matrix.arch }} - path: upload/TriliumNextNotes-linux-${{ matrix.arch }}-${{ github.ref_name }}.tar.xz - - name: Deploy release uses: WebFreak001/deploy-nightly@v3.2.0 with: From 3fb60b64c0e4cf44d83749814f55603df90cbb32 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 4 Feb 2025 21:55:13 +0200 Subject: [PATCH 10/10] fix(ci): add missing shell config --- .github/actions/build-server/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/build-server/action.yml b/.github/actions/build-server/action.yml index 685222057..162116e87 100644 --- a/.github/actions/build-server/action.yml +++ b/.github/actions/build-server/action.yml @@ -11,14 +11,17 @@ runs: node-version: 20 cache: "npm" - name: Install dependencies + shell: bash run: npm ci - name: Run Linux server build env: MATRIX_ARCH: ${{ inputs.arch }} + shell: bash run: | npm run update-build-info ./bin/build-server.sh - name: Prepare artifacts + shell: bash run: | mkdir -p upload file=$(find dist -name '*.tar.xz' -print -quit)