Bump version to 0.11.13 to match doltlite v0.11.13 #22
Workflow file for this run
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: Publish | |
| # Triggered by pushing a version tag: git tag v0.10.1 && git push --tags | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| # Build prebuilt binaries for each platform/arch before publishing. | |
| # Consumers get a fast install with no compilation required. | |
| prebuilds: | |
| name: Prebuilt — ${{ matrix.os }} ${{ matrix.arch }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| arch: x64 | |
| node_arch: x64 | |
| - os: ubuntu-latest | |
| arch: arm64 | |
| node_arch: x64 # cross-compile on x64 runner | |
| - os: macos-latest | |
| arch: x64 | |
| node_arch: x64 | |
| - os: macos-latest | |
| arch: arm64 | |
| node_arch: arm64 | |
| - os: windows-latest | |
| arch: x64 | |
| node_arch: x64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| architecture: ${{ matrix.node_arch }} | |
| - name: Download amalgamation | |
| run: node scripts/download.js | |
| - name: Install node-addon-api | |
| run: npm install --ignore-scripts | |
| - name: Build prebuilt (Linux arm64 cross-compile) | |
| if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64' | |
| run: | | |
| sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
| npm_config_arch=arm64 npm_config_target_arch=arm64 \ | |
| CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ \ | |
| npx node-gyp rebuild | |
| mkdir -p prebuilds/linux-arm64 | |
| cp build/Release/doltlite.node prebuilds/linux-arm64/doltlite.node | |
| - name: Build prebuilt (all others) | |
| if: "!(matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64')" | |
| shell: bash | |
| run: | | |
| npx node-gyp rebuild | |
| OS=$(node -p "process.platform") | |
| ARCH=${{ matrix.arch }} | |
| mkdir -p prebuilds/${OS}-${ARCH} | |
| cp build/Release/doltlite.node prebuilds/${OS}-${ARCH}/doltlite.node | |
| # The CLI binary is fetched by scripts/download.js in the | |
| # "Download amalgamation" step earlier and is already at | |
| # prebuilds/${platform}-${arch}/doltlite[.exe], so nothing extra | |
| # to do here. | |
| - name: Upload prebuilt artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: prebuilt-${{ matrix.os }}-${{ matrix.arch }} | |
| path: prebuilds/ | |
| retention-days: 1 | |
| publish: | |
| name: Publish to npm | |
| needs: prebuilds | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # to attach prebuilds to the GitHub release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| scope: "@dolthub" | |
| - name: Download all prebuilt artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: prebuilds/ | |
| merge-multiple: true | |
| - name: Install dependencies (skip build — we have prebuilts) | |
| run: npm install --ignore-scripts | |
| - name: Verify npm publish identity | |
| run: | | |
| npm config get registry | |
| npm config get @dolthub:registry | |
| npm whoami --registry=https://registry.npmjs.org/ | |
| npm access list collaborators @dolthub/doltlite --json || true | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish to npm | |
| run: | | |
| if npm publish --access public; then | |
| echo "Published." | |
| else | |
| v=$(node -p "require('./package.json').version") | |
| if npm view "@dolthub/doltlite@$v" version >/dev/null 2>&1; then | |
| echo "v$v is already published to npm; continuing to the GitHub release." | |
| else | |
| exit 1 | |
| fi | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # Rename prebuilds with platform prefix so they don't collide as GH release assets. | |
| - name: Stage release assets | |
| run: | | |
| mkdir -p release-assets | |
| for dir in prebuilds/*/; do | |
| platform=$(basename "$dir") | |
| cp "${dir}doltlite.node" "release-assets/doltlite-${platform}.node" | |
| # Some platforms also ship the doltlite CLI binary. | |
| if [ -f "${dir}doltlite" ]; then | |
| cp "${dir}doltlite" "release-assets/doltlite-${platform}" | |
| fi | |
| if [ -f "${dir}doltlite.exe" ]; then | |
| cp "${dir}doltlite.exe" "release-assets/doltlite-${platform}.exe" | |
| fi | |
| done | |
| - name: Create GitHub Release and attach prebuilds | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: release-assets/* | |
| generate_release_notes: true |