fix(pkg): yarn->npm, semantic-release-jsr, publish to jsr too #28
This file contains 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: Test & Release | |
on: | |
push: | |
jobs: | |
release: | |
name: Test & Release | |
runs-on: ubuntu-latest | |
permissions: | |
# https://github.com/semantic-release/semantic-release/issues/2469 | |
contents: write # create releases | |
issues: write # issue comments and labels | |
pull-requests: write # ditto | |
id-token: write # The OIDC ID token is used for authentication with JSR. | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- uses: oven-sh/setup-bun@v2 | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Run CI script (tests) | |
run: npm run ci | |
- name: Jest Coverage Comment | |
id: coverageComment | |
uses: MishaKav/jest-coverage-comment@main | |
with: | |
hide-comment: true | |
coverage-summary-path: ./coverage/coverage-summary.json | |
- name: Check the output coverage | |
run: | | |
echo "Coverage Percentage - ${{ steps.coverageComment.outputs.coverage }}" | |
echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}" | |
echo "Summary HTML - ${{ steps.coverageComment.outputs.summaryHtml }}" | |
- name: Create the badge | |
if: github.ref == 'refs/heads/main' | |
uses: schneegans/dynamic-badges-action@v1.7.0 | |
with: | |
auth: ${{ secrets.GH_TOKEN_GISTS }} | |
gistID: 26d0f88b04b6883e1a6bba5b9b344fab | |
filename: jest-coverage-comment__main.json | |
label: Coverage | |
message: ${{ steps.coverageComment.outputs.coverage }}% | |
color: ${{ steps.coverageComment.outputs.color }} | |
# namedLogo: javascript | |
- name: Save runtime tests result to gist | |
uses: exuanbo/actions-deploy-gist@v1 | |
with: | |
token: ${{ secrets.GH_TOKEN_GISTS }} | |
gist_id: f66f0ad9395e4019ec5209719377650b | |
file_path: ./tests/runtimes/results.yaml | |
- name: Release if relevant | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release |