name: NPM Snapshot on: pull_request: branches: [main, next-minor, next-major] paths: - 'ts-sdk/**' - '.changeset/**' workflow_dispatch: {} permissions: {} jobs: snapshot: name: Snapshot if: github.repository_owner == 'unionlabs' runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v4 with: lfs: true - uses: cachix/install-nix-action@v31 with: extra_nix_config: | trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M= trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org - name: Fetch from Cache env: ENVIRONMENT: ${{ env.ENVIRONMENT }} run: | nix build .#ts-sdk - name: Make writable snapshot copy run: | rm -rf ./snapshot-pkg rsync -a --copy-links ./result/dist ./snapshot-pkg/ chmod -R u+w ./snapshot-pkg - uses: actions/setup-node@v4 with: {node-version: 22} - uses: pnpm/action-setup@v3 with: version: 10 run_install: false - name: Create snapshot id: snapshot run: pnpm dlx pkg-pr-new@0.0.54 publish --pnpm --comment=off ./snapshot-pkg/dist