From 1abae725b2df4f2e13619d36b9b57a6357eb011a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Thu, 14 Nov 2024 17:04:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=20github=20actions=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E4=BD=BF=E7=94=A81=E4=B8=AA=20nodejs=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-and-release.yml | 103 ++++++----------------- .github/workflows/test-and-upload.yml | 104 ++++++------------------ 2 files changed, 46 insertions(+), 161 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 4b8bf8d..cbcd798 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -16,10 +16,8 @@ jobs: - windows - ubuntu - macos - node: - 17 - steps: - name: 'Checkout' uses: actions/checkout@v4.1.7 @@ -82,34 +80,7 @@ jobs: echo "--------------------"; lerna bootstrap --npm-client=yarn; - - name: 'npm run electron:build for node16' - if: ${{ matrix.node == '16' }} - run: | - echo "======================================================================"; - echo "cd packages/gui"; - echo "--------------------"; - cd packages/gui; - dir || ls -lah; - - echo "======================================================================"; - echo "npm run electron:build"; - echo "--------------------"; - npm run electron:build; - - echo "======================================================================"; - echo "cd dist_electron"; - echo "--------------------"; - cd dist_electron; - dir || ls -lah; - - echo "======================================================================"; - echo "cd ../../../"; - echo "--------------------"; - cd ../../../; - dir || ls -lah; - - - name: 'npm run electron:build for node17' - if: ${{ matrix.node != '16' }} + - name: 'npm run electron:build' env: NODE_OPTIONS: --openssl-legacy-provider run: | @@ -136,33 +107,33 @@ jobs: cd ../../../; dir || ls -lah; - - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.exe - Windows' + - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}.exe - Windows' uses: actions/upload-artifact@v4.4.0 if: ${{ matrix.os == 'windows' }} with: path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.exe - name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.exe' + name: 'DevSidecar-${{ steps.package-info.outputs.version }}.exe' if-no-files-found: error - - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.deb - Ubuntu' + - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}.deb - Ubuntu' uses: actions/upload-artifact@v4.4.0 if: ${{ matrix.os == 'ubuntu' }} with: path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.deb - name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.deb' + name: 'DevSidecar-${{ steps.package-info.outputs.version }}.deb' if-no-files-found: error - - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.AppImage - Ubuntu' + - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}.AppImage - Ubuntu' uses: actions/upload-artifact@v4.4.0 if: ${{ matrix.os == 'ubuntu' }} with: path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage - name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.AppImage' + name: 'DevSidecar-${{ steps.package-info.outputs.version }}.AppImage' if-no-files-found: error - - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.dmg - Mac' + - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}.dmg - Mac' uses: actions/upload-artifact@v4.4.0 if: ${{ matrix.os == 'macos' }} with: path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.dmg - name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.dmg' + name: 'DevSidecar-${{ steps.package-info.outputs.version }}.dmg' if-no-files-found: error # job 2 @@ -183,61 +154,33 @@ jobs: - name: 'Make "release" dir' run: mkdir release - # Download artifacts with node16 - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe - Windows' - uses: actions/download-artifact@v4.1.8 - with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe - path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb - Ubuntu' - uses: actions/download-artifact@v4.1.8 - with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb - path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage - Ubuntu' - uses: actions/download-artifact@v4.1.8 - with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage - path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg - Mac' - uses: actions/download-artifact@v4.1.8 - with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg - path: release - - name: 'Rename "release/DevSidecar-${{ steps.package-info.outputs.version }}.*" to "release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.*"' - run: | - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.exe release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.deb release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg; - - # Download artifacts with node17 - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe - Windows' + # Download artifacts + - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}.exe - Windows' uses: actions/download-artifact@v4.1.8 with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe + name: DevSidecar-${{ steps.package-info.outputs.version }}.exe path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb - Ubuntu' + - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}.deb - Ubuntu' uses: actions/download-artifact@v4.1.8 with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb + name: DevSidecar-${{ steps.package-info.outputs.version }}.deb path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage - Ubuntu' + - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}.AppImage - Ubuntu' uses: actions/download-artifact@v4.1.8 with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage + name: DevSidecar-${{ steps.package-info.outputs.version }}.AppImage path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg - Mac' + - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}.dmg - Mac' uses: actions/download-artifact@v4.1.8 with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg + name: DevSidecar-${{ steps.package-info.outputs.version }}.dmg path: release - - name: 'Rename "release/DevSidecar-${{ steps.package-info.outputs.version }}.*" to "release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.*"' + - name: 'Rename "release/DevSidecar-${{ steps.package-info.outputs.version }}.*" to "release/DevSidecar-${{ steps.package-info.outputs.version }}.*"' run: | - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.exe release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.deb release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg; + mv release/DevSidecar-${{ steps.package-info.outputs.version }}.exe release/DevSidecar-${{ steps.package-info.outputs.version }}.exe; + mv release/DevSidecar-${{ steps.package-info.outputs.version }}.deb release/DevSidecar-${{ steps.package-info.outputs.version }}.deb; + mv release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage; + mv release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg; - name: 'Print files from "release" dir' run: | diff --git a/.github/workflows/test-and-upload.yml b/.github/workflows/test-and-upload.yml index 52cbc04..92c25cb 100644 --- a/.github/workflows/test-and-upload.yml +++ b/.github/workflows/test-and-upload.yml @@ -20,11 +20,8 @@ jobs: - windows - ubuntu - macos - node: - - 16 - 17 - steps: - name: 'Checkout' uses: actions/checkout@v4.1.7 @@ -87,34 +84,7 @@ jobs: echo "--------------------"; lerna bootstrap --npm-client=yarn; - - name: 'npm run electron:build for node16' - if: ${{ matrix.node == '16' }} - run: | - echo "======================================================================"; - echo "cd packages/gui"; - echo "--------------------"; - cd packages/gui; - dir || ls -lah; - - echo "======================================================================"; - echo "npm run electron:build"; - echo "--------------------"; - npm run electron:build; - - echo "======================================================================"; - echo "cd dist_electron"; - echo "--------------------"; - cd dist_electron; - dir || ls -lah; - - echo "======================================================================"; - echo "cd ../../../"; - echo "--------------------"; - cd ../../../; - dir || ls -lah; - - - name: 'npm run electron:build for node17' - if: ${{ matrix.node != '16' }} + - name: 'npm run electron:build' env: NODE_OPTIONS: --openssl-legacy-provider run: | @@ -141,33 +111,33 @@ jobs: cd ../../../; dir || ls -lah; - - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.exe - Windows' + - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}.exe - Windows' uses: actions/upload-artifact@v4.4.0 if: ${{ matrix.os == 'windows' }} with: path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.exe - name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.exe' + name: 'DevSidecar-${{ steps.package-info.outputs.version }}.exe' if-no-files-found: error - - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.deb - Ubuntu' + - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}.deb - Ubuntu' uses: actions/upload-artifact@v4.4.0 if: ${{ matrix.os == 'ubuntu' }} with: path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.deb - name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.deb' + name: 'DevSidecar-${{ steps.package-info.outputs.version }}.deb' if-no-files-found: error - - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.AppImage - Ubuntu' + - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}.AppImage - Ubuntu' uses: actions/upload-artifact@v4.4.0 if: ${{ matrix.os == 'ubuntu' }} with: path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage - name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.AppImage' + name: 'DevSidecar-${{ steps.package-info.outputs.version }}.AppImage' if-no-files-found: error - - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.dmg - Mac' + - name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}.dmg - Mac' uses: actions/upload-artifact@v4.4.0 if: ${{ matrix.os == 'macos' }} with: path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.dmg - name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.dmg' + name: 'DevSidecar-${{ steps.package-info.outputs.version }}.dmg' if-no-files-found: error # job 2 @@ -189,61 +159,33 @@ jobs: - name: 'Make "release" dir' run: mkdir release - # Download artifacts with node16 - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe - Windows' - uses: actions/download-artifact@v4.1.8 - with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe - path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb - Ubuntu' - uses: actions/download-artifact@v4.1.8 - with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb - path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage - Ubuntu' - uses: actions/download-artifact@v4.1.8 - with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage - path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg - Mac' - uses: actions/download-artifact@v4.1.8 - with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg - path: release - - name: 'Rename "release/DevSidecar-${{ steps.package-info.outputs.version }}.*" to "release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.*"' - run: | - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.exe release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.deb release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg; - - # Download artifacts with node17 - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe - Windows' + # Download artifacts + - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}.exe - Windows' uses: actions/download-artifact@v4.1.8 with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe + name: DevSidecar-${{ steps.package-info.outputs.version }}.exe path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb - Ubuntu' + - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}.deb - Ubuntu' uses: actions/download-artifact@v4.1.8 with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb + name: DevSidecar-${{ steps.package-info.outputs.version }}.deb path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage - Ubuntu' + - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}.AppImage - Ubuntu' uses: actions/download-artifact@v4.1.8 with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage + name: DevSidecar-${{ steps.package-info.outputs.version }}.AppImage path: release - - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg - Mac' + - name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}.dmg - Mac' uses: actions/download-artifact@v4.1.8 with: - name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg + name: DevSidecar-${{ steps.package-info.outputs.version }}.dmg path: release - - name: 'Rename "release/DevSidecar-${{ steps.package-info.outputs.version }}.*" to "release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.*"' + - name: 'Rename "release/DevSidecar-${{ steps.package-info.outputs.version }}.*" to "release/DevSidecar-${{ steps.package-info.outputs.version }}.*"' run: | - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.exe release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.deb release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage; - mv release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg; + mv release/DevSidecar-${{ steps.package-info.outputs.version }}.exe release/DevSidecar-${{ steps.package-info.outputs.version }}.exe; + mv release/DevSidecar-${{ steps.package-info.outputs.version }}.deb release/DevSidecar-${{ steps.package-info.outputs.version }}.deb; + mv release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage; + mv release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg; - name: 'Print files from "release" dir' run: |