Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: release

on:
push:
# release/v* picks up hand edits to an open release PR
branches: [main, 'release/v*']
pull_request:
types: [closed]
branches: [main]
# merged release PRs, publish reruns, and prereleases all arrive here
workflow_dispatch:
inputs:
prerelease:
description: 'Cut a prerelease instead of a normal release, e.g. `beta`, `rc`, or `0`'
required: false
default: ''
npm-tag:
description: 'npm dist-tag to publish to. Set by uppt/release for maintenance lines; leave blank otherwise'
required: false
default: ''

permissions: {}

jobs:
# open or update a draft release PR from conventional commits
pr:
if: |
!github.event.repository.fork
&& (
(
github.event_name == 'push'
&& (
github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|| startsWith(github.ref, 'refs/heads/release/v')
)
) || (
github.event_name == 'workflow_dispatch'
&& !startsWith(github.ref, 'refs/tags/')
)
)
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: danielroe/uppt/pr@6ec27140623aa835e362f866d8ab0018ab057f4d # v0.6.11
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ inputs.prerelease }}

# release PR merged: tag it, cut a GitHub release, dispatch the publish run
release:
if: |
github.event_name == 'pull_request'
&& github.event.pull_request.merged == true
&& startsWith(github.event.pull_request.head.ref, 'release/v')
&& github.event.pull_request.head.repo.full_name == github.repository
&& !github.event.repository.fork
runs-on: ubuntu-latest
concurrency:
group: release-${{ github.event.pull_request.number }}
cancel-in-progress: false
permissions:
contents: write
actions: write
steps:
- uses: danielroe/uppt/release@6ec27140623aa835e362f866d8ab0018ab057f4d # v0.6.11
with:
token: ${{ secrets.GITHUB_TOKEN }}

# the chained dispatch lands here on the vX.Y.Z tag; build the tarball(s)
pack:
if: github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
concurrency:
group: pack-${{ github.ref }}
cancel-in-progress: false
permissions: {}
outputs:
files: ${{ steps.pack.outputs.files }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

# install pnpm and node from devEngines instead of corepack; no cache on the release runner
- uses: pnpm/setup@a0881977cd8ea73b1ed212236c99ca10dcc80cf4 # v3.1.1
with:
runtime: node@24.21.0
install: false

- run: pnpm install --frozen-lockfile --ignore-scripts

- id: pack
uses: danielroe/uppt/pack@6ec27140623aa835e362f866d8ab0018ab057f4d # v0.6.11
with:
checkout: false
install: false

# stage the prebuilt tarball(s) to npm via OIDC
publish:
if: |
github.event_name == 'workflow_dispatch'
&& startsWith(github.ref, 'refs/tags/v')
&& needs.pack.outputs.files != '[]'
needs: pack
runs-on: ubuntu-latest
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
permissions:
id-token: write
environment: npm
steps:
- uses: danielroe/uppt/publish@6ec27140623aa835e362f866d8ab0018ab057f4d # v0.6.11
with:
files: ${{ needs.pack.outputs.files }}
npm-tag: ${{ inputs.npm-tag }}
242 changes: 0 additions & 242 deletions CHANGELOG.md

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
"dist"
],
"scripts": {
"build": "nuxt-module-build build",
"build": "nuxt-module-build prepare && nuxt-module-build build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && pnpm -C playground-v5 exec nuxt prepare",
"dev:v5": "pnpm -C playground-v5 exec nuxt dev",
"lint": "eslint . --cache",
"lint:fix": "eslint . --cache --fix",
"prepack": "pnpm build",
"release": "pnpm lint && pnpm test && pnpm prepack && changelogen --release && pnpm publish && git push --follow-tags",
"test": "vitest run",
"test:types": "vue-tsc --noEmit && vue-tsc -b playground --noEmit",
"test:watch": "vitest watch"
Expand All @@ -55,7 +54,6 @@
"@nuxt/module-builder": "^1.0.3",
"@nuxt/test-utils": "^4.3.3",
"@vue/test-utils": "^2.5.1",
"changelogen": "^0.6.2",
"crawler-user-agents": "^1.62.0",
"eslint": "^10.12.0",
"happy-dom": "^20.14.6",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading