clone

a deno framework for local-first web apps that open instantly, work offline and sync when users choose

main
lofi / .github / workflows / publish.yml
publish.yml 2.0K
1name: Publish to JSR23# Tag a release (e.g. `git tag v0.1.0 && git push origin v0.1.0`) to publish4# @nzip/lofi to JSR. The tag version must match the "version" in deno.json.5on:6 push:7 tags:8 - "v*.*.*"910jobs:11 publish:12 runs-on: ubuntu-latest13 permissions:14 contents: read15 id-token: write # required for JSR OIDC authentication16 steps:17 - uses: actions/checkout@v61819 - uses: denoland/setup-deno@v220 with:21 deno-version: v2.x2223 - name: Verify tag matches deno.json version24 run: |25 tag="${GITHUB_REF_NAME#v}"26 manifest="$(deno eval 'console.log(JSON.parse(Deno.readTextFileSync("deno.json")).version)')"27 if [ "$tag" != "$manifest" ]; then28 echo "::error::tag v$tag does not match deno.json version $manifest"29 exit 130 fi3132 - name: Formatting, lint, and unit/integration tests33 run: deno task check3435 - name: Reference production build36 run: deno task build --cwd apps/reference3738 - name: Publish dry run39 run: deno task publish:dry --allow-dirty4041 - name: Install Chromium42 run: deno task test:browser:install4344 - name: Reset incidental workspace changes from validation steps45 # the reference build and test runs regenerate lockfiles in the46 # runner's checkout; publishing must see exactly the tagged tree47 run: |48 git status --short49 git checkout -- .5051 - name: Publish to JSR52 run: deno publish5354 - name: Generated-app golden journey (exact published version)55 run: |56 version="${GITHUB_REF_NAME#v}"57 deno run -A tools/golden.ts --source registry --version "$version"5859 - name: Retain sanitized golden failure evidence60 if: failure()61 uses: actions/upload-artifact@v462 with:63 name: generated-app-registry-golden-failure64 path: test-results/golden/65 if-no-files-found: ignore66 retention-days: 7