chore(deps): update all non-major dependencies #563
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: Test Libvirt | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| if: github.ref == 'refs/heads/main' | |
| id: release | |
| with: | |
| release-type: node | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [release-please] | |
| # Run on all PRs, or when a release is created | |
| if: ${{ github.event_name == 'pull_request' || needs.release-please.outputs.release_created }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Cache APT Packages | |
| uses: awalsh128/[email protected] | |
| with: | |
| packages: libvirt-dev qemu-system qemu-user-static | |
| version: 1.0 | |
| - name: Set Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ".nvmrc" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v5 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: pnpm install | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm run build | |
| - name: Publish to NPM with trusted publishing | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| run: npm publish | |
| prebuild: | |
| name: Build and (Possibly) Publish Pre-built Binaries | |
| needs: [release-please] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| node-version: [18, 22] # 18 is required for cloudflare workers | |
| arch: [amd64, arm64] | |
| os: [ubuntu-latest, macos-latest] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ needs.release-please.outputs.tag_name }} | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Set Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Install build dependencies | |
| run: | | |
| case "${{ matrix.os }}" in | |
| ubuntu*) sudo apt-get update && sudo apt-get install -y libvirt-dev ;; | |
| macos*) brew install libvirt ;; | |
| esac | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build native module | |
| run: pnpm build/native | |
| - name: Set file naming variables | |
| id: filename-vars | |
| shell: bash | |
| run: | | |
| # Normalize OS name | |
| case "${{ matrix.os }}" in | |
| ubuntu*) PLATFORM="linux" ;; | |
| macos*) PLATFORM="darwin" ;; | |
| *) PLATFORM="${{ matrix.os }}" ;; | |
| esac | |
| # Normalize architecture | |
| case "${{ matrix.arch }}" in | |
| amd64) ARCH_NAME="x64" ;; | |
| arm64) ARCH_NAME="arm64" ;; | |
| *) ARCH_NAME="${{ matrix.arch }}" ;; | |
| esac | |
| # Get Node.js ABI version | |
| NODE_ABI=$(node -e "console.log(process.versions.modules)") | |
| # Construct filename | |
| FILENAME="libvirt-${{ needs.release-please.outputs.tag_name }}-node-v${NODE_ABI}-${PLATFORM}-${ARCH_NAME}.tar.gz" | |
| echo "FILENAME=$FILENAME" >> $GITHUB_OUTPUT | |
| - name: Package binary | |
| run: | | |
| mkdir -p deploy | |
| cd ${{ github.workspace }}/build/Release | |
| tar -czf ${{ github.workspace }}/deploy/${{ steps.filename-vars.outputs.FILENAME }} . | |
| - name: Validate tarball | |
| run: | | |
| tar -tf ${{ github.workspace }}/deploy/${{ steps.filename-vars.outputs.FILENAME }} | |
| - name: Upload Release Assets | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| echo "Uploading ${{ steps.filename-vars.outputs.FILENAME }} to release..." | |
| gh release upload "${{ needs.release-please.outputs.tag_name }}" "deploy/${{ steps.filename-vars.outputs.FILENAME }}" --clobber |