chore: try some rust ci things #115
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: CI | |
| on: | |
| push: | |
| branches: ['**'] | |
| tags: ['v**'] | |
| env: | |
| DENO_VERSION: 2.1.6 | |
| jobs: | |
| health: | |
| name: Health | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: denoland/setup-deno@v1 | |
| with: | |
| deno-version: ${{ env.DENO_VERSION }} | |
| - run: deno lint | |
| - run: deno fmt --check | |
| - run: deno check lib/*.ts | |
| - run: deno test --no-check --coverage | |
| - run: deno coverage | |
| validation: | |
| name: w3c Validation | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: denoland/setup-deno@v1 | |
| with: | |
| deno-version: ${{ env.DENO_VERSION }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - run: pip install -r ./validation/requirements.txt | |
| - name: w3c validation test | |
| run: ./validation/test.sh | |
| dryrun: | |
| needs: [health, validation] | |
| name: 'Publish (dry run)' | |
| if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: denoland/setup-deno@v1 | |
| with: | |
| deno-version: ${{ env.DENO_VERSION }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: deno task build | |
| - run: npm publish --dry-run | |
| working-directory: npm | |
| - run: deno publish --no-check --dry-run | |
| # https://jsr.io/docs/publishing-packages#publishing-from-github-actions | |
| # https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry | |
| publish: | |
| needs: [health, validation] | |
| name: Publish | |
| runs-on: ubuntu-24.04-arm | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: read | |
| id-token: write # -> authentication | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: denoland/setup-deno@v1 | |
| with: | |
| deno-version: ${{ env.DENO_VERSION }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: deno task build | |
| - name: 'Publish → jsr' | |
| if: ${{ !contains(github.ref, '-next.') }} | |
| run: deno publish --no-check | |
| - name: 'Publish → npm' | |
| if: ${{ !contains(github.ref, '-next.') }} | |
| run: npm publish --provenance --access public | |
| working-directory: npm | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: 'Publish → npm (pre-release)' | |
| if: ${{ contains(github.ref, '-next.') }} | |
| run: npm publish --tag next --provenance --access public | |
| working-directory: npm | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |