Skip to content

Commit

Permalink
feat: add ltpr workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
modbender authored and modbender committed Sep 4, 2024
1 parent b39103d commit 7c3bc41
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 32 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ltpr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Lint, Test, Publish and Release

permissions:
checks: write
contents: write

on:
push:
tags:
- "v*"

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

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: "package.json"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

lint:
needs: common
runs-on: ubuntu-latest
steps:
- name: Run linters
uses: wearerequired/lint-action@v2
with:
auto_fix: true
eslint: true
prettier: true

test:
needs: lint
runs-on: ubuntu-latest
steps:
- run: pnpm test

publish:
needs: test
runs-on: ubuntu-latest
steps:
- run: pnpm prepack
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

release:
needs: publish
runs-on: ubuntu-latest
steps:
- run: npx --yes changelogithub@latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
28 changes: 0 additions & 28 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-disqus",
"version": "1.0.1",
"version": "1.1.1",
"description": "Disqus for Nuxt 3",
"repository": "modbender/nuxt-disqus",
"license": "MIT",
Expand Down Expand Up @@ -37,7 +37,7 @@
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
"release": "pnpm run lint && pnpm run test && pnpm run prepack && changelogen --release && pnpm publish && git push --follow-tags",
"release": "pnpm lint && pnpm test && pnpm prepack && changelogen --release && pnpm publish && git push --follow-tags",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "vitest run",
Expand Down
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { name, version } from '../package.json'

import type { ModuleOptions } from './types'

export default defineNuxtModule({
export default defineNuxtModule<ModuleOptions>({
meta: {
name,
version,
Expand Down
2 changes: 1 addition & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ declare module 'nuxt-disqus' {
interface NuxtOptions {
disqus?: ModuleOptions
}
}
}

0 comments on commit 7c3bc41

Please sign in to comment.