Bump brace-expansion and jsdoc-to-markdown #524
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| release: | |
| types: [ published ] | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - 'package.json' | |
| - 'CHANGELOG.md' | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| inputs: | |
| tags: | |
| required: false | |
| description: 'Misc tags' | |
| # cancel older, redundant runs of same workflow on same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-deps: | |
| name: Build Dependencies | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| matrix: | |
| config: | |
| - { os: windows-latest, target: "windows", arch: "x64" } | |
| - { os: ubuntu-22.04, target: "linux", arch: "x64" } | |
| - { os: ubuntu-22.04, target: "linux", arch: "arm64" } | |
| - { os: macos-15-intel, target: "macos", arch: "x64" } | |
| - { os: macos-15, target: "macos", arch: "arm64" } | |
| fail-fast: false | |
| env: | |
| CI_CACHE: '${{ github.workspace }}/.ci.cache' | |
| VCPKG_FORCE_SYSTEM_BINARIES: 1 | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| VCPKG_BINARY_SOURCES: 'clear;files,${{ github.workspace }}/.ci.cache,readwrite' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: 'recursive' | |
| # token: ${{ secrets.ZITI_CI_GH_TOKEN }} | |
| - name: macOS tools | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: brew install autoconf autoconf-archive automake pkg-config libtool | |
| - name: Setup PkgConfig (Windows) | |
| if: matrix.config.target == 'windows' | |
| run: | | |
| choco install pkgconfiglite | |
| - name: Get crossbuild tools | |
| if: matrix.config.target == 'linux' && matrix.config.arch != 'x64' | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y crossbuild-essential-${{ matrix.config.arch }} | |
| - name: Node Version | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: Extract branch name | |
| shell: bash | |
| run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | |
| id: extract_branch | |
| - name: Print branch name | |
| shell: bash | |
| run: | | |
| echo "## branch name is: ${{ steps.extract_branch.outputs.branch }}" | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date)" >> $GITHUB_OUTPUT | |
| - name: Install CMake/Ninja | |
| uses: lukka/get-cmake@v4.3.2 | |
| - name: Run VCPKG | |
| uses: lukka/run-vcpkg@v11 | |
| # will use baseline from vcpkg.json | |
| with: | |
| # get baseline from vcpkg | |
| vcpkgJsonGlob: './vcpkg.json' | |
| - name: show versions | |
| run: | | |
| echo ===== gcc ===== | |
| gcc --version | |
| echo ===== cmake ===== | |
| cmake --version | |
| echo "ninja: $(ninja --version)" | |
| echo "node: $(node --version)" | |
| echo "npm: $(npm --version)" | |
| - name: restore dependencies cache | |
| uses: actions/cache/restore@v5 | |
| id: cache-restore | |
| with: | |
| path: ${{ env.CI_CACHE }} | |
| key: deps-${{ matrix.config.target }}-${{ matrix.config.arch }}-${{ hashFiles('./vcpkg.json', './vcpkg-overlays/**/*') }} | |
| restore-keys: | | |
| dep-${{ matrix.config.target }}-${{ matrix.config.arch }}- | |
| dep-${{ matrix.config.arch }}- | |
| - name: Build Dependencies | |
| shell: bash | |
| run: | | |
| echo $PWD | |
| npm install --dev cmake-js | |
| npm run build:configure -- --target_arch=${{ matrix.config.arch }} | |
| env: | |
| PRESET: ci-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
| TARGET_ARCH: ${{ matrix.config.arch }} | |
| - name: cache dependencies | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: ${{ env.CI_CACHE }} | |
| key: ${{ steps.cache-restore.outputs.cache-primary-key }} | |
| # ------------------------------------------------------------------------------- | |
| # Do a clean build, test, and publish | |
| # ------------------------------------------------------------------------------- | |
| build: | |
| name: Build for Node-${{ matrix.node_ver }} ${{ matrix.config.target }}/${{ matrix.config.arch }} | |
| runs-on: ${{ matrix.config.os }} | |
| needs: | |
| - build-deps | |
| # container: ${{ matrix.config.container }} | |
| permissions: | |
| id-token: write | |
| contents: write | |
| env: | |
| BUILD_NUMBER: ${{ github.run_number }} | |
| AWS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| CI_CACHE: '${{ github.workspace }}/.ci.cache' | |
| VCPKG_FORCE_SYSTEM_BINARIES: 1 | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| VCPKG_BINARY_SOURCES: 'clear;files,${{ github.workspace }}/.ci.cache,readwrite' | |
| strategy: | |
| matrix: | |
| config: | |
| - { os: windows-latest, target: "windows", arch: "x64" } | |
| - { os: ubuntu-22.04, target: "linux", arch: "x64" } | |
| - { os: ubuntu-22.04, target: "linux", arch: "arm64" } | |
| - { os: macos-15-intel, target: "macos", arch: "x64" } | |
| - { os: macos-15, target: "macos", arch: "arm64" } | |
| node_ver: [ 20, 22, 24, 25 ] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: 'recursive' | |
| # token: ${{ secrets.ZITI_CI_GH_TOKEN }} | |
| - name: macOS tools | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: brew install autoconf autoconf-archive automake pkg-config libtool | |
| - name: Setup PkgConfig (Windows) | |
| if: matrix.config.target == 'windows' | |
| run: | | |
| choco install pkgconfiglite | |
| - name: Get crossbuild tools | |
| if: matrix.config.target == 'linux' && matrix.config.arch != 'x64' | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y crossbuild-essential-${{ matrix.config.arch }} | |
| - name: Node Version | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node_ver }} | |
| - name: Extract branch name | |
| shell: bash | |
| run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | |
| id: extract_branch | |
| - name: Print branch name | |
| shell: bash | |
| run: | | |
| echo "## branch name is: ${{ steps.extract_branch.outputs.branch }}" | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date)" >> $GITHUB_OUTPUT | |
| - name: Install CMake/Ninja | |
| uses: lukka/get-cmake@v4.3.2 | |
| - name: Run VCPKG | |
| uses: lukka/run-vcpkg@v11 | |
| # will use baseline from vcpkg.json | |
| with: | |
| # get baseline from vcpkg | |
| vcpkgJsonGlob: './vcpkg.json' | |
| - name: show versions | |
| run: | | |
| echo ===== gcc ===== | |
| gcc --version | |
| echo ===== cmake ===== | |
| cmake --version | |
| echo "ninja: $(ninja --version)" | |
| echo "node: $(node --version)" | |
| echo "npm: $(npm --version)" | |
| - name: restore dependencies cache | |
| uses: actions/cache/restore@v5 | |
| id: cache-restore | |
| with: | |
| path: ${{ env.CI_CACHE }} | |
| key: deps-${{ matrix.config.target }}-${{ matrix.config.arch }}-${{ hashFiles('./vcpkg.json', './vcpkg-overlays/**/*') }} | |
| - name: Build NodeJS-SDK | |
| id: buildSDK | |
| run: | | |
| cd ${{ runner.workspace }}/${{ github.event.repository.name }} | |
| npm install --build-from-source | |
| npm run build:package -- --target_arch=${{ matrix.config.arch }} | |
| env: | |
| PRESET: ci-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
| TARGET_ARCH: ${{ matrix.config.arch }} | |
| BUILD_DATE: ${{ steps.date.outputs.date }} | |
| - name: show build result | |
| if: always() | |
| run: echo build result ${{ steps.buildSDK.outcome }} | |
| - name: debug build failure | |
| if: always() && steps.buildSDK.outcome == 'failure' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-logs-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
| path: | | |
| ./vcpkg/buildtrees/**/*.log | |
| ./build/**/*log | |
| - name: Run tests | |
| # run tests on matching arch | |
| # skip tests on Windows and node20: test globbing does not work there | |
| if: | | |
| matrix.config.arch == runner.arch && | |
| (matrix.node_ver != '20' || matrix.config.target != 'windows') | |
| shell: bash | |
| run: npm test | |
| - name: upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ziti_nodejs_${{ matrix.config.target }}_${{ matrix.config.arch }}_nodev${{ matrix.node_ver }} | |
| path: | | |
| ./build/stage/**/ziti_sdk_nodejs*.tar.gz | |
| if-no-files-found: error | |
| publish: | |
| name: Publish Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Node Version | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: ./artifacts | |
| pattern: ziti_nodejs_* | |
| - name: list artifacts | |
| run: | | |
| find ./artifacts -type f -exec ls -l {} \; | |
| - name: upload release binaries | |
| uses: softprops/action-gh-release@v3 | |
| if: github.ref_type == 'tag' | |
| with: | |
| fail_on_unmatched_files: true | |
| files: | | |
| ./artifacts/**/ziti_sdk_nodejs*.tar.gz | |
| - name: NPM Publish | |
| if: github.ref_type == 'tag' | |
| run: | | |
| npm publish --access public --tag alpha |