Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv committed Nov 15, 2024
1 parent ef493cf commit 385d27a
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: denoland/setup-deno@v2

- run: deno lint

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: denoland/setup-deno@v2

- run: deno fmt --check

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: denoland/setup-deno@v2

- run: deno check mod.ts

- run: deno publish --allow-dirty --dry-run
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on:
push:
tags:
- "*"

permissions:
contents: write
id-token: write

jobs:
publish-jsr:
name: Publish to JSR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: denoland/setup-deno@v2

- run: deno publish

publish-npm:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: denoland/setup-deno@v2

- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: https://registry.npmjs.org

- uses: pnpm/action-setup@v4
with:
version: 8

- name: Transform and Publish
run: |
deno -A _transform.ts
cd dist
npm publish --access public
env:
__TYPE_MAP: 1
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

create-release:
name: Create Release
needs: publish-npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: softprops/action-gh-release@v1
with:
prerelease: true
generate_release_notes: true

0 comments on commit 385d27a

Please sign in to comment.