mirror: A tiny/fast dataloader implementation
0

Configure Feed

Select the types of activity you want to include in your feed.

ci: auto publish to deno/npm

Marais Rossouw (Sep 4, 2024, 3:21 PM +1000) e12908f5 df38ce6f

+66 -10
+66 -10
.github/workflows/ci.yml
··· 2 2 3 3 on: 4 4 push: 5 - workflow_call: 5 + branches: ["**"] 6 + tags: ["v**"] 7 + 8 + env: 9 + DENO_VERSION: 1.46 6 10 7 11 jobs: 8 - deno: 12 + health: 13 + name: Health 9 14 runs-on: ubuntu-latest 10 15 steps: 11 16 - uses: actions/checkout@v4 12 17 - uses: denoland/setup-deno@v1 18 + with: 19 + deno-version: ${{ env.DENO_VERSION }} 13 20 21 + - run: deno lint 14 22 - run: deno fmt --check 15 - - run: deno lint 16 - - run: deno check **.ts 23 + - run: deno check lib/*.ts 17 24 18 - - name: Tests 19 - run: |- 20 - deno test --coverage=cov/ 21 - deno coverage cov/ 25 + - run: deno test --no-check --coverage 26 + - run: deno coverage 22 27 23 - npm: 28 + dryrun: 29 + needs: [health] 30 + name: "Publish (dry run)" 31 + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} 24 32 runs-on: ubuntu-latest 25 33 steps: 26 34 - uses: actions/checkout@v4 27 35 - uses: denoland/setup-deno@v1 36 + with: 37 + deno-version: ${{ env.DENO_VERSION }} 38 + - uses: actions/setup-node@v4 39 + with: 40 + node-version: 20 41 + registry-url: "https://registry.npmjs.org" 28 42 29 - - run: mkdir -p npm 30 43 - run: deno task build 44 + - run: npm publish --dry-run 45 + working-directory: npm 46 + - run: deno publish --no-check --dry-run 47 + 48 + # https://jsr.io/docs/publishing-packages#publishing-from-github-actions 49 + # https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry 50 + publish: 51 + needs: [health] 52 + name: Publish 53 + runs-on: ubuntu-latest 54 + if: startsWith(github.ref, 'refs/tags/v') 55 + permissions: 56 + contents: read 57 + id-token: write # -> authentication 58 + steps: 59 + - uses: actions/checkout@v4 60 + - uses: denoland/setup-deno@v1 61 + with: 62 + deno-version: ${{ env.DENO_VERSION }} 63 + - uses: actions/setup-node@v4 64 + with: 65 + node-version: 20 66 + registry-url: "https://registry.npmjs.org" 67 + 68 + - run: deno task build 69 + 70 + - name: "Publish → jsr" 71 + if: ${{ !contains(github.ref, '-next.') }} 72 + run: deno publish --no-check 73 + 74 + - name: "Publish → npm" 75 + if: ${{ !contains(github.ref, '-next.') }} 76 + run: npm publish --provenance --access public 77 + working-directory: npm 78 + env: 79 + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 80 + 81 + - name: "Publish → npm (pre-release)" 82 + if: ${{ contains(github.ref, '-next.') }} 83 + run: npm publish --tag next --provenance --access public 84 + working-directory: npm 85 + env: 86 + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}