From 21d7eb95a1da542f4d6d4ae3e5ef2f1eefc003f7 Mon Sep 17 00:00:00 2001 From: agracio Date: Thu, 19 Sep 2024 04:14:52 +0100 Subject: [PATCH] updating GitHub pipeline --- .github/workflows/build.yml | 200 ++++++++++++++++-------------------- 1 file changed, 91 insertions(+), 109 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22b4bc9e..c7d8631f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,8 +22,7 @@ jobs: build: runs-on: ${{ matrix.os }} outputs: - test-version: ${{ steps.electron-test-version.outputs.test-version }} - node: ${{ steps.node-version.outputs.version }} + node-version: ${{ steps.node-test-version.outputs.node-version }} strategy: # fail-fast: false matrix: @@ -34,20 +33,6 @@ jobs: name: build ${{ matrix.os }}-v${{ inputs.build-version }} steps: - # - name: Make Request - # id: node-version-request - # uses: fjogeleit/http-request-action@v1 - # with: - # url: 'https://nodejs.org/dist/index.json' - # method: 'GET' - - # - name: Show Response - # run: | - # echo ${{ steps.myRequest.outputs.response }} - # echo ${{ steps.myRequest.outputs.headers }} - # echo ${{ steps.myRequest.outputs.status }} - # echo ${{ fromJson(steps.myRequest.outputs.response).field_you_want_to_access }} - - name: Checkout code uses: actions/checkout@v4 @@ -58,78 +43,75 @@ jobs: os: ${{ matrix.os }} - name: Get latest Node.js version - id: node-version + id: node-test-version run: | node tools/getVersionAction.js ${{ inputs.build-version }} - echo "version=$(cat node.txt)" >> $GITHUB_OUTPUT + echo "node-version=$(cat node.txt)" >> $GITHUB_OUTPUT - - name: Print latest Node.js version - run: | - core.setFailed("${{steps.node-version.outputs.version}}") + # - name: Print latest Node.js version + # run: | + # core.setFailed("${{steps.node-test-version.outputs.node-version}}") - - name: Resolve Electron version for test - id: electron-test-version - shell: bash - run: | - if [[ ${{ inputs.build-version }} == '29.0.0' ]]; then - echo "test-version=29.4.6" >> $GITHUB_OUTPUT - elif [[ ${{ inputs.build-version }} == '30.0.0' ]]; then - echo "test-version=30.5.1" >> $GITHUB_OUTPUT - elif [[ ${{ inputs.build-version }} == '31.0.0' ]]; then - echo "test-version=31.6.0" >> $GITHUB_OUTPUT - fi - # else - # core.setFailed("Unable to resolve Electron version for testing") - # fi + # - name: Resolve Electron version for test + # id: electron-test-version + # shell: bash + # run: | + # if [[ ${{ inputs.build-version }} == '29.0.0' ]]; then + # echo "test-version=29.4.6" >> $GITHUB_OUTPUT + # elif [[ ${{ inputs.build-version }} == '30.0.0' ]]; then + # echo "test-version=30.5.1" >> $GITHUB_OUTPUT + # elif [[ ${{ inputs.build-version }} == '31.0.0' ]]; then + # echo "test-version=31.6.0" >> $GITHUB_OUTPUT + # fi - - name: install node-gyp - run: npm i -g node-gyp + # - name: install node-gyp + # run: npm i -g node-gyp - - name: Create release folder - run: | - mkdir "release\ia32\${{ inputs.build-version }}" - mkdir "release\x64\${{ inputs.build-version }}" - mkdir "release\arm64\${{ inputs.build-version }}" + # - name: Create release folder + # run: | + # mkdir "release\ia32\${{ inputs.build-version }}" + # mkdir "release\x64\${{ inputs.build-version }}" + # mkdir "release\arm64\${{ inputs.build-version }}" - - name: Build ia32 - timeout-minutes: 30 - run: | - node-gyp configure build --target=${{ inputs.build-version }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=ia32 - cmd /c copy /y build\Release\edge_*.node release\ia32\${{ inputs.build-version }} - cmd /c rmdir /S /Q build + # - name: Build ia32 + # timeout-minutes: 30 + # run: | + # node-gyp configure build --target=${{ inputs.build-version }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=ia32 + # cmd /c copy /y build\Release\edge_*.node release\ia32\${{ inputs.build-version }} + # cmd /c rmdir /S /Q build - - name: Build x64 - timeout-minutes: 30 - run: | - node-gyp configure build --target=${{ inputs.build-version }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=x64 - cmd /c copy /y build\Release\edge_*.node release\x64\${{ inputs.build-version }} - cmd /c rmdir /S /Q build + # - name: Build x64 + # timeout-minutes: 30 + # run: | + # node-gyp configure build --target=${{ inputs.build-version }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=x64 + # cmd /c copy /y build\Release\edge_*.node release\x64\${{ inputs.build-version }} + # cmd /c rmdir /S /Q build - - name: Build arm64 - timeout-minutes: 30 - shell: pwsh - run: | - node-gyp configure --target=${{ inputs.build-version }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=arm64 + # - name: Build arm64 + # timeout-minutes: 30 + # shell: pwsh + # run: | + # node-gyp configure --target=${{ inputs.build-version }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=arm64 - (Get-Content -Raw build/build_managed.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/build_managed.vcxproj - (Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj - (Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj + # (Get-Content -Raw build/build_managed.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/build_managed.vcxproj + # (Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj + # (Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj - node-gyp build - cmd /c copy /y build\Release\edge_*.node release\arm64\${{ inputs.build-version }} - cmd /c rmdir /S /Q build + # node-gyp build + # cmd /c copy /y build\Release\edge_*.node release\arm64\${{ inputs.build-version }} + # cmd /c rmdir /S /Q build - - name: Upload artifacts - uses: actions/upload-artifact@v4 - if: success() - with: - name: ${{ inputs.build-version }} - path: | - release + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # if: success() + # with: + # name: ${{ inputs.build-version }} + # path: | + # release test: runs-on: ${{ matrix.os }} @@ -141,53 +123,53 @@ jobs: os: [windows-2022] # fail-fast: false - name: test ${{ matrix.os }}-v${{ needs.build.outputs.test-version }} + name: test ${{ matrix.os }}-v${{ needs.build.outputs.node-version }} steps: - name: Checkout code uses: actions/checkout@v4 - - name: Setup env - uses: ./.github/actions/setup-env - with: - electron: ${{ needs.build.outputs.test-version }} - os: ${{ matrix.os }} - replace-version: true + # - name: Setup env + # uses: ./.github/actions/setup-env + # with: + # electron: ${{ needs.build.outputs.test-version }} + # os: ${{ matrix.os }} + # replace-version: true - - uses: agracio/github-substring-action@v1.0.0 - id: electron_version - with: - value: ${{ needs.build.outputs.test-version }} - length_from_start: 2 + # - uses: agracio/github-substring-action@v1.0.0 + # id: electron_version + # with: + # value: ${{ needs.build.outputs.test-version }} + # length_from_start: 2 - - name: Create release folder - run: | - cmd /c if not exist "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0" - cmd /c if not exist "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0" - cmd /c if not exist "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0" + # - name: Create release folder + # run: | + # cmd /c if not exist "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0" + # cmd /c if not exist "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0" + # cmd /c if not exist "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0" - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - path: release - pattern: ${{ steps.electron_version.outputs.substring }}.0.0* + # - name: Download artifacts + # uses: actions/download-artifact@v4 + # with: + # path: release + # pattern: ${{ steps.electron_version.outputs.substring }}.0.0* - - run: ls -R release + # - run: ls -R release - - name: Copy artifacts - run: | - cmd /c copy /y release\${{ steps.electron_version.outputs.substring }}.0.0\x64\${{ steps.electron_version.outputs.substring }}.0.0\edge_*.node lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0 + # - name: Copy artifacts + # run: | + # cmd /c copy /y release\${{ steps.electron_version.outputs.substring }}.0.0\x64\${{ steps.electron_version.outputs.substring }}.0.0\edge_*.node lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0 - - name: Test - timeout-minutes: 10 - uses: ./.github/actions/test-windows - with: - electron: ${{ needs.build.outputs.test-version }} + # - name: Test + # timeout-minutes: 10 + # uses: ./.github/actions/test-windows + # with: + # electron: ${{ needs.build.outputs.test-version }} - - name: Test report - uses: ./.github/actions/create-test-report - with: - electron: ${{ needs.build.outputs.test-version }} - os: ${{ matrix.os }} - name: 'build-tests' + # - name: Test report + # uses: ./.github/actions/create-test-report + # with: + # electron: ${{ needs.build.outputs.test-version }} + # os: ${{ matrix.os }} + # name: 'build-tests' \ No newline at end of file