diff --git a/.github/workflows/check_pre-merge_develop.yml b/.github/workflows/check_pre-merge_develop.yml index 5ba4f791..eede5395 100644 --- a/.github/workflows/check_pre-merge_develop.yml +++ b/.github/workflows/check_pre-merge_develop.yml @@ -12,10 +12,9 @@ on: env: CMAKE_BUILD_PARALLEL_LEVEL: 4 - IMAGE_NODE_VERSION: 14 - GITHUB_ELEMENTS_VERSION: v0.0.10 - GITHUB_BITCOIN_VERSION: v0.0.10 - GITHUB_DOCKER_IMAGE: docker.pkg.github.com/cryptogarageinc/elements-testing-dockerfile/elements-testing + GITHUB_ELEMENTS_VERSION: v0.2.3 + GITHUB_BITCOIN_VERSION: v0.2.3 + GITHUB_DOCKER_IMAGE: ghcr.io/cryptogarageinc/elements-testing ELEMENTS_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_entrypoint.sh BITCOIN_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_bitcoin_entrypoint.sh @@ -26,54 +25,44 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-10.15, windows-2019, ubuntu-18.04] - node: [12, 14, 16] - include: - - node: 12 - always: false - - node: 14 - always: false - - node: 16 - always: true + os: [macos-11, windows-2019, ubuntu-20.04] + node: [16, 18, 19, 20] + exclude: + - os: macos-11 + node: 14 + - os: macos-11 + node: 19 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - timeout-minutes: 1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + timeout-minutes: 2 with: node-version: ${{ matrix.node }} - - name: update to npm v7 - if: runner.os == 'Windows' || matrix.node == '16' - run: npm i -g npm@7 + cache: 'npm' + cache-dependency-path: package-lock.json + - name: update to npm v8 + run: npm i -g npm@8 - name: dump node version id: node_ver run: | export node_ver="$(node --version)" - echo "::set-output name=node_version::$node_ver" + echo "node_version=$node_ver" >> $GITHUB_OUTPUT echo "node_version=$node_ver" shell: bash - name: node_modules-useCache - uses: actions/cache@v1 + uses: actions/cache@v3 id: node_cache with: path: node_modules - key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }} + key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}-0 + restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('package-lock.json') }}- - name: npm info if: steps.node_cache.outputs.cache-hit != 'true' id: npm_info run: | npm --version - echo "::set-output name=temp_npm_cachedir::$(npm config get cache)" - - name: use npm cache - if: runner.os != 'Windows' && steps.node_cache.outputs.cache-hit != 'true' - uses: actions/cache@v1 - id: npm_cache - with: - path: ${{ steps.npm_info.outputs.temp_npm_cachedir }} - key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0 - restore-keys: | - npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}- + echo "temp_npm_cachedir=$(npm config get cache)" >> $GITHUB_OUTPUT - name: npm_install if: steps.node_cache.outputs.cache-hit != 'true' env: @@ -82,7 +71,7 @@ jobs: npm set progress=false npm ci - name: build - if: steps.node_cache.outputs.cache-hit == 'true' || ${{ matrix.always }} == 'true' + if: steps.node_cache.outputs.cache-hit == 'true' run: npm run cmake_release_parallel - name: test_all run: npm run test @@ -100,40 +89,42 @@ jobs: bitcoin-e2e-test: name: bitcoin e2e test - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + timeout-minutes: 30 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login GitHub Registry run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }} - name: Pull image from GitHub Registry run: docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} - name: integration test run: | - docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} + docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} elements-e2e-test: name: elements e2e test - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + timeout-minutes: 40 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login GitHub Registry run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }} - name: Pull image from GitHub Registry run: docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} - name: integration test run: | - docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} + docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} doxygen-ubuntu: name: doxygen-ubuntu - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install_doxygen run: sudo apt install doxygen graphviz - name: doxygen_check diff --git a/.github/workflows/check_pre-merge_master.yml b/.github/workflows/check_pre-merge_master.yml index e5428a86..6dfcf4c5 100644 --- a/.github/workflows/check_pre-merge_master.yml +++ b/.github/workflows/check_pre-merge_master.yml @@ -12,10 +12,9 @@ on: env: CMAKE_BUILD_PARALLEL_LEVEL: 4 - IMAGE_NODE_VERSION: 14 - GITHUB_ELEMENTS_VERSION: v0.0.10 - GITHUB_BITCOIN_VERSION: v0.0.10 - GITHUB_DOCKER_IMAGE: docker.pkg.github.com/cryptogarageinc/elements-testing-dockerfile/elements-testing + GITHUB_ELEMENTS_VERSION: v0.1.0 + GITHUB_BITCOIN_VERSION: v0.1.0 + GITHUB_DOCKER_IMAGE: ghcr.io/cryptogarageinc/elements-testing ELEMENTS_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_entrypoint.sh BITCOIN_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_bitcoin_entrypoint.sh @@ -26,54 +25,44 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-10.15, windows-2019, ubuntu-18.04] - node: [12, 14, 16] - include: - - node: 12 - always: false - - node: 14 - always: false - - node: 16 - always: true + os: [macos-11, windows-2019, ubuntu-20.04] + node: [16, 18, 19, 20] + exclude: + - os: macos-11 + node: 14 + - os: macos-11 + node: 19 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - timeout-minutes: 1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + timeout-minutes: 2 with: node-version: ${{ matrix.node }} - - name: update to npm v7 - if: runner.os == 'Windows' || matrix.node == '16' - run: npm i -g npm@7 + cache: 'npm' + cache-dependency-path: package-lock.json + - name: update to npm v8 + run: npm i -g npm@8 - name: dump node version id: node_ver run: | export node_ver="$(node --version)" - echo "::set-output name=node_version::$node_ver" + echo "node_version=$node_ver" >> $GITHUB_OUTPUT echo "node_version=$node_ver" shell: bash - name: node_modules-useCache - uses: actions/cache@v1 + uses: actions/cache@v3 id: node_cache with: path: node_modules - key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }} + key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}-0 + restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('package-lock.json') }}- - name: npm info if: steps.node_cache.outputs.cache-hit != 'true' id: npm_info run: | npm --version - echo "::set-output name=temp_npm_cachedir::$(npm config get cache)" - - name: use npm cache - if: runner.os != 'Windows' && steps.node_cache.outputs.cache-hit != 'true' - uses: actions/cache@v1 - id: npm_cache - with: - path: ${{ steps.npm_info.outputs.temp_npm_cachedir }} - key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0 - restore-keys: | - npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}- + echo "temp_npm_cachedir=$(npm config get cache)" >> $GITHUB_OUTPUT - name: npm_install if: steps.node_cache.outputs.cache-hit != 'true' env: @@ -82,7 +71,7 @@ jobs: npm set progress=false npm ci - name: build - if: steps.node_cache.outputs.cache-hit == 'true' || ${{ matrix.always }} == 'true' + if: steps.node_cache.outputs.cache-hit == 'true' run: npm run cmake_release_parallel - name: test_all run: npm run test @@ -100,40 +89,42 @@ jobs: bitcoin-e2e-test: name: bitcoin e2e test - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + timeout-minutes: 30 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login GitHub Registry run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }} - name: Pull image from GitHub Registry run: docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} - name: integration test run: | - docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} + docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} elements-e2e-test: name: elements e2e test - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + timeout-minutes: 40 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login GitHub Registry run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }} - name: Pull image from GitHub Registry run: docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} - name: integration test run: | - docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} + docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} doxygen-ubuntu: name: doxygen-ubuntu - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install_doxygen run: sudo apt install doxygen graphviz - name: doxygen_check diff --git a/.github/workflows/check_pre-merge_sprint.yml b/.github/workflows/check_pre-merge_sprint.yml index 1dfe43c1..5c17696d 100644 --- a/.github/workflows/check_pre-merge_sprint.yml +++ b/.github/workflows/check_pre-merge_sprint.yml @@ -4,16 +4,16 @@ on: push: branches: - features/sprint* + - feature/ci-* pull_request: branches: - features/sprint* env: CMAKE_BUILD_PARALLEL_LEVEL: 4 - IMAGE_NODE_VERSION: 14 - GITHUB_ELEMENTS_VERSION: v0.0.10 - GITHUB_BITCOIN_VERSION: v0.0.10 - GITHUB_DOCKER_IMAGE: docker.pkg.github.com/cryptogarageinc/elements-testing-dockerfile/elements-testing + GITHUB_ELEMENTS_VERSION: v0.2.3 + GITHUB_BITCOIN_VERSION: v0.2.3 + GITHUB_DOCKER_IMAGE: ghcr.io/cryptogarageinc/elements-testing ELEMENTS_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_entrypoint.sh BITCOIN_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_bitcoin_entrypoint.sh @@ -24,59 +24,44 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-10.15, windows-2019, ubuntu-18.04] - node: [12, 14, 16] + os: [macos-11, windows-2019, ubuntu-20.04] + node: [16, 18, 19, 20] exclude: - - os: macos-10.15 - node: 12 - - os: macos-10.15 - node: 16 - include: - - node: 12 - always: false - - node: 14 - always: false - - node: 16 - always: true + - os: macos-11 + node: 14 + - os: macos-11 + node: 19 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - timeout-minutes: 1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + timeout-minutes: 2 with: node-version: ${{ matrix.node }} - - name: update to npm v7 - if: runner.os == 'Windows' || matrix.node == '16' - run: npm i -g npm@7 + cache: 'npm' + cache-dependency-path: package-lock.json + - name: update to npm v8 + run: npm i -g npm@8 - name: dump node version id: node_ver run: | export node_ver="$(node --version)" - echo "::set-output name=node_version::$node_ver" + echo "node_version=$node_ver" >> $GITHUB_OUTPUT echo "node_version=$node_ver" shell: bash - name: node_modules-useCache - uses: actions/cache@v1 + uses: actions/cache@v3 id: node_cache with: path: node_modules - key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }} + key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}-0 + restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('package-lock.json') }}- - name: npm info if: steps.node_cache.outputs.cache-hit != 'true' id: npm_info run: | npm --version - echo "::set-output name=temp_npm_cachedir::$(npm config get cache)" - - name: use npm cache - if: runner.os != 'Windows' && steps.node_cache.outputs.cache-hit != 'true' - uses: actions/cache@v1 - id: npm_cache - with: - path: ${{ steps.npm_info.outputs.temp_npm_cachedir }} - key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0 - restore-keys: | - npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}- + echo "temp_npm_cachedir=$(npm config get cache)" >> $GITHUB_OUTPUT - name: npm_install if: steps.node_cache.outputs.cache-hit != 'true' env: @@ -85,7 +70,7 @@ jobs: npm set progress=false npm ci - name: build - if: steps.node_cache.outputs.cache-hit == 'true' || ${{ matrix.always }} == 'true' + if: steps.node_cache.outputs.cache-hit == 'true' run: npm run cmake_release_parallel - name: test_all run: npm run test @@ -103,40 +88,42 @@ jobs: bitcoin-e2e-test: name: bitcoin e2e test - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + timeout-minutes: 30 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login GitHub Registry run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }} - name: Pull image from GitHub Registry run: docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} - name: integration test run: | - docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} + docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} elements-e2e-test: name: elements e2e test - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + timeout-minutes: 40 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login GitHub Registry run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }} - name: Pull image from GitHub Registry run: docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} - name: integration test run: | - docker run -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} + docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} doxygen-ubuntu: name: doxygen-ubuntu - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install_doxygen run: sudo apt install doxygen graphviz - name: doxygen_check diff --git a/.github/workflows/code_scanner.yml b/.github/workflows/code_scanner.yml index 52884d0a..a01c7f40 100644 --- a/.github/workflows/code_scanner.yml +++ b/.github/workflows/code_scanner.yml @@ -23,7 +23,7 @@ on: jobs: analyze-CodeQL: name: CodeQL - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -36,14 +36,14 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: # We must fetch at least the immediate parents so that if this is a pull request then we can checkout the head. fetch-depth: 2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -54,7 +54,16 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + if: matrix.language == 'javascript' + uses: github/codeql-action/autobuild@v2 + - name: Manual Build + if: matrix.language != 'javascript' + env: + CFDJS_UNUSE_ASSET: true + run: | + npm set progress=false + npm ci + npm run cmake_release_parallel # ℹ️ Command-line programs to run using the OS shell. # https://git.io/JvXDl @@ -66,4 +75,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/create_release-and-upload.yml b/.github/workflows/create_release-and-upload.yml index 99d6fbf8..66f73dfe 100644 --- a/.github/workflows/create_release-and-upload.yml +++ b/.github/workflows/create_release-and-upload.yml @@ -6,21 +6,20 @@ on: - 'v*' env: - XCODE_VERSION: 10.3 + XCODE_VERSION: 11.7 + NODE_VERSION: 18 jobs: create_releases: name: create-releases - runs-on: ubuntu-18.04 - outputs: - release_url: ${{ steps.output_url.outputs.upload_url }} + runs-on: ubuntu-20.04 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT shell: bash - name: check package.json version env: @@ -28,29 +27,15 @@ jobs: run: node ./tools/checker.js version ${version} - name: Create Release id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + name: Release ${{ steps.get_version.outputs.VERSION }} body: | Changes in this Release - First Change - Second Change - draft: false prerelease: true continue-on-error: true - - name: Get release - if: steps.create_release.outcome == 'failure' - id: get_release - uses: bruceadams/get-release@v1.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: output url - id: output_url - run: | - echo "::set-output name=upload_url::${{steps.get_release.outputs.upload_url}}${{steps.create_release.outputs.upload_url}}" upload-object-windows-vs2019: name: upload-object-win-vs2019 @@ -59,24 +44,24 @@ jobs: steps: - name: checkout - uses: actions/checkout@v2 - - uses: actions/setup-node@v2.1.2 + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 timeout-minutes: 1 with: - node-version: 14 + node-version: ${{ env.NODE_VERSION }} + - name: cmake version + id: cmake_version + shell: bash + run: cmake --version - name: update to npm v7 run: npm i -g npm@7 - - name: output url - id: get_url - run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}" - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT shell: bash - - name: dump version - env: - version: ${{ steps.get_version.outputs.VERSION }} - run: echo "version=${version}" + - name: Get the asset name + id: asset_name + run: echo "ASSET_NAME=cfdjs-api-${{ steps.get_version.outputs.VERSION }}-win-vs2019-x86_64.zip" >> $GITHUB_OUTPUT shell: bash - name: create folder run: mkdir dist @@ -98,20 +83,15 @@ jobs: - name: create archive file run: | cd dist - Compress-Archive -Path ./* -DestinationPath ../cfd.zip + Compress-Archive -Path ./* -DestinationPath ../${{ steps.asset_name.outputs.ASSET_NAME }} cd .. echo "---- dump zip file ----" dir . - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ steps.get_url.outputs.upload_url }} - asset_path: ./cfd.zip - asset_name: cfdjs-api-${{ steps.get_version.outputs.VERSION }}-win-vs2019-x86_64.zip - asset_content_type: application/zip + files: ${{ steps.asset_name.outputs.ASSET_NAME }} - name: cleanup run: rm -rf build shell: bash @@ -129,14 +109,24 @@ jobs: upload-object-ubuntu: name: upload-object-ubuntu needs: create_releases - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + timeout-minutes: 1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: cmake version + id: cmake_version + run: cmake --version - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + - name: Get the asset name + id: asset_name + run: echo "ASSET_NAME=cfdjs-api-${{ steps.get_version.outputs.VERSION }}-ubuntu2004-gcc-x86_64.zip" >> $GITHUB_OUTPUT - name: list run: ls -a $GITHUB_WORKSPACE - name: create folder @@ -160,22 +150,14 @@ jobs: - name: create archive file run: | cd dist - zip -r cfd.zip usr + zip -r ../${{ steps.asset_name.outputs.ASSET_NAME }} usr echo "---- dump zip file ----" - ls -l - - name: output url - id: get_url - run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}" + ls -l ../*.zip - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ steps.get_url.outputs.upload_url }} - asset_path: ./dist/cfd.zip - asset_name: cfdjs-api-${{ steps.get_version.outputs.VERSION }}-ubuntu1804-gcc-x86_64.zip - asset_content_type: application/zip + files: ${{ steps.asset_name.outputs.ASSET_NAME }} - name: npm install run: npm install timeout-minutes: 20 @@ -189,14 +171,25 @@ jobs: upload-object-macos: name: upload-object-macos needs: create_releases - runs-on: macos-10.15 + runs-on: macos-11 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + timeout-minutes: 1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: cmake version + id: cmake_version + shell: bash + run: cmake --version - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + - name: Get the asset name + id: asset_name + run: echo "ASSET_NAME=cfdjs-api-${{ steps.get_version.outputs.VERSION }}-osx-xcode${{ env.XCODE_VERSION }}-x86_64.zip" >> $GITHUB_OUTPUT - name: Select Xcode version run: sudo xcode-select -s '/Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer' - name: Show Xcode version @@ -224,22 +217,14 @@ jobs: - name: create archive file run: | cd dist - zip -r cfd.zip usr + zip -r ../${{ steps.asset_name.outputs.ASSET_NAME }} usr echo "---- dump zip file ----" - ls -l - - name: output url - id: get_url - run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}" + ls -l ../*.zip - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ steps.get_url.outputs.upload_url }} - asset_path: ./dist/cfd.zip - asset_name: cfdjs-api-${{ steps.get_version.outputs.VERSION }}-osx-xcode${{ env.XCODE_VERSION }}-x86_64.zip - asset_content_type: application/zip + files: ${{ steps.asset_name.outputs.ASSET_NAME }} - name: npm install run: npm install timeout-minutes: 20 @@ -249,3 +234,41 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npm run prebuild_upload_all -- ${GITHUB_TOKEN} + + upload-object-alpine: + name: upload-object-alpine3.16 + needs: create_releases + runs-on: ubuntu-20.04 + + steps: + - name: checkout + uses: actions/checkout@v3 + - name: Get the version + id: get_version + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + - name: Get the asset name + id: asset_name + run: echo "ASSET_NAME=cfdjs-api-${{ steps.get_version.outputs.VERSION }}-alpine314-musl-x86_64.zip" >> $GITHUB_OUTPUT + - name: list + run: ls -a $GITHUB_WORKSPACE + - name: create folder + run: | + echo "---- dump output data ----" + mkdir dist + - name: docker run + uses: docker://alpine:3.16 + with: + entrypoint: /github/workspace/.github/workflows/docker/alpine_build_entrypoint.sh + - name: rename asset + run: mv ./dist/cfd.zip ${{ steps.asset_name.outputs.ASSET_NAME }} + - name: Upload Release Asset + id: upload-release-asset + uses: softprops/action-gh-release@v1 + with: + files: ${{ steps.asset_name.outputs.ASSET_NAME }} + - name: docker run + uses: docker://node:18.16-alpine3.16 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + entrypoint: /github/workspace/.github/workflows/docker/alpine_release_entrypoint.sh diff --git a/.github/workflows/docker/alpine_build_entrypoint.sh b/.github/workflows/docker/alpine_build_entrypoint.sh new file mode 100755 index 00000000..643e2b02 --- /dev/null +++ b/.github/workflows/docker/alpine_build_entrypoint.sh @@ -0,0 +1,44 @@ +#!/bin/sh -l + +apk add --update --no-cache musl gcc g++ make git cmake zip + +cd /github/workspace +ls + +mkdir dist +mkdir build + +cmake --version +cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_SHARED=on -DENABLE_CAPI=off -DENABLE_TESTS=off -DTARGET_RPATH="@executable_path;/usr/local/lib;/usr/local/lib64;./node_modules/cfd-js/build/Release;../node_modules/cfd-js/build/Release;../../node_modules/cfd-js/build/Release;../../../node_modules/cfd-js/build/Release;../../../../node_modules/cfd-js/build/Release;../../../../../node_modules/cfd-js/build/Release;../../../../../../node_modules/cfd-js/build/Release;./build/Release;./build/Release;./wrap_js/dl_lib/lib" +cmake --build build --parallel 4 --config Release + +cd build +make install DESTDIR=../dist +cd .. +rm -rf dist/usr/local/cmake/wallycore-* dist/usr/local/lib/pkgconfig/wallycore.pc +rm -rf dist/usr/local/lib/wallycore.* dist/usr/local/lib/libwallycore.* + +cd dist +zip -r cfd.zip usr +echo "---- dump zip file ----" +ls -l +cd .. + +echo "ls dist" +ls /github/workspace/dist +echo "ls dist/usr" +ls /github/workspace/dist/usr +echo "ls dist/usr/local" +ls /github/workspace/dist/usr/local +echo "ls dist/usr/local/lib" +ls /github/workspace/dist/usr/local/lib* + +# cleanup +echo "cleanup" +rm -rf build external/cfd external/cfd-core external/libwally-core + +echo "ls" +ls /github/workspace/ + +echo "ls external" +ls /github/workspace/external/ diff --git a/.github/workflows/docker/alpine_release_entrypoint.sh b/.github/workflows/docker/alpine_release_entrypoint.sh new file mode 100755 index 00000000..707088d2 --- /dev/null +++ b/.github/workflows/docker/alpine_release_entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh -l + +apk add --update --no-cache musl gcc g++ make git cmake zip + +cd /github/workspace +ls + +echo "npm install" +npm install + +echo "npm run prebuild_napi" +npm run prebuild_napi + +echo "ls prebuild" +ls prebuild + +echo "npm run prebuild_upload_all" +npm run prebuild_upload_all -- ${GITHUB_TOKEN} diff --git a/.github/workflows/docker/test_bitcoin_entrypoint.sh b/.github/workflows/docker/test_bitcoin_entrypoint.sh index b721cd00..be853011 100755 --- a/.github/workflows/docker/test_bitcoin_entrypoint.sh +++ b/.github/workflows/docker/test_bitcoin_entrypoint.sh @@ -32,8 +32,19 @@ set -e if [ ! -d node_modules ]; then mkdir node_modules fi -chmod 777 node_modules +chmod -R 777 node_modules node --version npm install npm run cmake_release_parallel -npm run bitcoin_test + +NODE_MAJOR_VER=$(node --version | sed -r 's/^v([0-9]+).([0-9]+).([0-9]+)(\..*)?$/\1/') +NODE_MINOR_VER=$(node --version | sed -r 's/^v([0-9]+).([0-9]+).([0-9]+)(\..*)?$/\2/') +if [ $NODE_MAJOR_VER -gt 18 ]; then + echo "node version $NODE_MAJOR_VER" ; + NODE_OPTIONS="--no-experimental-fetch" npm run bitcoin_test ; +elif test "$NODE_MAJOR_VER" = "18" && test "$NODE_MINOR_VER" != "0"; then + echo "node version $NODE_MAJOR_VER.$NODE_MINOR_VER" ; + NODE_OPTIONS="--no-experimental-fetch" npm run bitcoin_test ; +else + npm run bitcoin_test +fi diff --git a/.github/workflows/docker/test_entrypoint.sh b/.github/workflows/docker/test_entrypoint.sh index 47c9c717..28b5f487 100755 --- a/.github/workflows/docker/test_entrypoint.sh +++ b/.github/workflows/docker/test_entrypoint.sh @@ -31,6 +31,7 @@ do bitcoin-cli --regtest -datadir=${WORKDIR_PATH}/bitcoind_datadir ping > /dev/null 2>&1 done echo "start bitcoin node" +bitcoin-cli --regtest -datadir=${WORKDIR_PATH}/bitcoind_datadir createwallet wallet false false "" false false elementsd -chain=liquidregtest -datadir=${WORKDIR_PATH}/elementsd_datadir -pak=02b6991705d4b343ba192c2d1b10e7b8785202f51679f26a1f2cdbe9c069f8dceb024fb0908ea9263bedb5327da23ff914ce1883f851337d71b3ca09b32701003d05 elements-cli -chain=liquidregtest -datadir=${WORKDIR_PATH}/elementsd_datadir ping > /dev/null 2>&1 @@ -45,8 +46,19 @@ set -e if [ ! -d node_modules ]; then mkdir node_modules fi -chmod 777 node_modules +chmod -R 777 node_modules node --version npm install npm run cmake_release_parallel -npm run elements_test + +NODE_MAJOR_VER=$(node --version | sed -r 's/^v([0-9]+).([0-9]+).([0-9]+)(\..*)?$/\1/') +NODE_MINOR_VER=$(node --version | sed -r 's/^v([0-9]+).([0-9]+).([0-9]+)(\..*)?$/\2/') +if [ $NODE_MAJOR_VER -gt 18 ]; then + echo "node version $NODE_MAJOR_VER" ; + NODE_OPTIONS="--no-experimental-fetch" npm run elements_test ; +elif test "$NODE_MAJOR_VER" = "18" && test "$NODE_MINOR_VER" != "0"; then + echo "node version $NODE_MAJOR_VER.$NODE_MINOR_VER" ; + NODE_OPTIONS="--no-experimental-fetch" npm run elements_test ; +else + npm run elements_test +fi