From 1b0d2541fd4f49db65a3c53307806c959335966e Mon Sep 17 00:00:00 2001 From: Damian Glowala Date: Fri, 16 Oct 2026 22:22:48 +0200 Subject: [PATCH] ci: migrate release workflow to uppt --- .github/workflows/release.yml | 118 +++++++++++++++++ CHANGELOG.md | 242 ---------------------------------- package.json | 4 +- pnpm-lock.yaml | 3 - 4 files changed, 119 insertions(+), 248 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..aef74934 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 7709d099..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,242 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -## v4.0.0 - -[compare changes](https://github.com/nuxt-modules/device/compare/v3.2.4...v4.0.0) - -### 🚀 Enhancements - -- Add `isLinux` flag ([#243](https://github.com/nuxt-modules/device/pull/243)) -- ⚠️ Drop support for Nuxt 2 and remove `bridge` compatibility option ([c91cebe](https://github.com/nuxt-modules/device/commit/c91cebe)) -- Move to ESM-only ([78f00e3](https://github.com/nuxt-modules/device/commit/78f00e3)) -- Remove deprecated options and update README ([58b6e19](https://github.com/nuxt-modules/device/commit/58b6e19)) - -### 🏡 Chore - -- Lint ([837d4a8](https://github.com/nuxt-modules/device/commit/837d4a8)) -- Update playground tsconfig to Nuxt 4 ([1c9c59e](https://github.com/nuxt-modules/device/commit/1c9c59e)) -- Lint ([df53a93](https://github.com/nuxt-modules/device/commit/df53a93)) -- Update pnpm workspace ([24aa73e](https://github.com/nuxt-modules/device/commit/24aa73e)) -- Update inlineDependencies to specify 'crawler-user-agents' explicitly ([5199650](https://github.com/nuxt-modules/device/commit/5199650)) -- Update package.json ([b20e980](https://github.com/nuxt-modules/device/commit/b20e980)) - -### 🤖 CI - -- Use latest corepack ([c79a102](https://github.com/nuxt-modules/device/commit/c79a102)) - -#### ⚠️ Breaking Changes - -- ⚠️ Drop support for Nuxt 2 and remove `bridge` compatibility option ([c91cebe](https://github.com/nuxt-modules/device/commit/c91cebe)) - -### ❤️ Contributors - -- Damian Glowala ([@DamianGlowala](https://github.com/DamianGlowala)) -- Alan Schio ([@schirrel](https://github.com/schirrel)) - -## v3.2.4 - -[compare changes](https://github.com/nuxt-modules/device/compare/v3.2.3...v3.2.4) - -### 🩹 Fixes - -- Inline `crawler-user-agents` dependency ([#232](https://github.com/nuxt-modules/device/pull/232)) - -### 🤖 CI - -- Run CI workflow on Node version from matrix ([c504a6f](https://github.com/nuxt-modules/device/commit/c504a6f)) - -### ❤️ Contributors - -- Damian Głowala ([@DamianGlowala](http://github.com/DamianGlowala)) - -## v3.2.3 - -[compare changes](https://github.com/nuxt-modules/device/compare/v3.2.2...v3.2.3) - -### 🩹 Fixes - -- Generate crawlers regex at build time ([#230](https://github.com/nuxt-modules/device/pull/230)) - -### 🏡 Chore - -- Update README and module options JSDoc ([5483663](https://github.com/nuxt-modules/device/commit/5483663)) -- Unpin dependencies and update renovate config ([a12c6a4](https://github.com/nuxt-modules/device/commit/a12c6a4)) - -### ❤️ Contributors - -- Damian Głowala ([@DamianGlowala](https://github.com/DamianGlowala)) - -## v3.2.2 - -[compare changes](https://github.com/nuxt-modules/device/compare/v3.2.1...v3.2.2) - -### 🩹 Fixes - -- Move runtime types to `src/runtime/` dir ([57a658a](https://github.com/nuxt-modules/device/commit/57a658a)) - -### ❤️ Contributors - -- Damian Głowala ([@DamianGlowala](https://github.com/DamianGlowala)) - -## v3.2.1 - -[compare changes](https://github.com/nuxt-modules/device/compare/v3.2.0...v3.2.1) - -### 🚀 Enhancements - -- Deprecate `enabled` option ([7b64ac6](https://github.com/nuxt-modules/device/commit/7b64ac6)) - -### 🩹 Fixes - -- Do not warn about `refreshOnResize` deprecation if not explicitly used ([11196cd](https://github.com/nuxt-modules/device/commit/11196cd)) -- Add augmentations for `$device` helper ([e758cc6](https://github.com/nuxt-modules/device/commit/e758cc6)) - -### 💅 Refactors - -- Use single return in plugin ([401a366](https://github.com/nuxt-modules/device/commit/401a366)) -- Shorten `useDevice` syntax ([e528ba7](https://github.com/nuxt-modules/device/commit/e528ba7)) - -### 🏡 Chore - -- Use local module in playground ([eca8ff1](https://github.com/nuxt-modules/device/commit/eca8ff1)) - -### ❤️ Contributors - -- Damian Głowala ([@DamianGlowala](https://github.com/DamianGlowala)) - -## v3.2.0 - -[compare changes](https://github.com/nuxt-modules/device/compare/v3.1.1...v3.2.0) - -### 🚀 Enhancements - -- Module overhaul ([#199](https://github.com/nuxt-modules/device/pull/199)) -- Deprecate `refreshOnResize` option ([#211](https://github.com/nuxt-modules/device/pull/211)) -- Detect `Google-InspectionTool` crawler ([#219](https://github.com/nuxt-modules/device/pull/219)) -- Replace manual crawler regex generation with `crawler-user-agents` ([#224](https://github.com/nuxt-modules/device/pull/224)) - -### 🩹 Fixes - -- Import Nuxt composables from `#imports` ([#174](https://github.com/nuxt-modules/device/pull/174)) -- Update to latest `@nuxt/module-builder` ([#223](https://github.com/nuxt-modules/device/pull/223)) -- Augment runtime config on `@nuxt/schema` ([a84ad64](https://github.com/nuxt-modules/device/commit/a84ad64)) -- Disable 'vue/multi-word-component-names' for `test/` dir ([502d5b1](https://github.com/nuxt-modules/device/commit/502d5b1)) -- Account for absence of module's runtime config in plugin ([a311d11](https://github.com/nuxt-modules/device/commit/a311d11)) - -### 📖 Documentation - -- Use new `nuxi module add` command in installation ([#187](https://github.com/nuxt-modules/device/pull/187)) -- Update link to `2.x` branch ([2aec2e7](https://github.com/nuxt-modules/device/commit/2aec2e7)) -- Remove unused badges ([4cdf090](https://github.com/nuxt-modules/device/commit/4cdf090)) -- Revert removing badges ([eea7813](https://github.com/nuxt-modules/device/commit/eea7813)) -- Update badges style and links ([d290e56](https://github.com/nuxt-modules/device/commit/d290e56)) -- Add banner ([1130799](https://github.com/nuxt-modules/device/commit/1130799)) - -### 🏡 Chore - -- Add pull request template ([2de7def](https://github.com/nuxt-modules/device/commit/2de7def)) -- Lint pull request template ([0faf42f](https://github.com/nuxt-modules/device/commit/0faf42f)) -- Update renovate config ([855e082](https://github.com/nuxt-modules/device/commit/855e082)) -- Test bundler module resolution ([#181](https://github.com/nuxt-modules/device/pull/181)) -- Indicate compatibility with new v4 major ([#216](https://github.com/nuxt-modules/device/pull/216)) -- Exclude `2.x` branch from renovate ([487f042](https://github.com/nuxt-modules/device/commit/487f042)) -- Remove commented out module config from test fixture ([6d860a4](https://github.com/nuxt-modules/device/commit/6d860a4)) - -### 🤖 CI - -- Add label PR workflow ([50a9f4f](https://github.com/nuxt-modules/device/commit/50a9f4f)) -- Add reproduire ([#188](https://github.com/nuxt-modules/device/pull/188)) - -### ❤️ Contributors - -- Damian Głowala ([@DamianGlowala](https://github.com/DamianGlowala)) -- Daniel Roe ([@danielroe](https://github.com/danielroe)) -- Dmitriy Kuts - -### [3.1.1](https://github.com/nuxt-modules/device/compare/v3.1.0...v3.1.1) (2023-09-16) - - * #157 chore: export runtime - * #158 fix of problem with export named 'default' in nuxt 3 - -## [3.1.0](https://github.com/nuxt-community/device-module/compare/v3.0.0...v3.1.0) (2023-02-08) - - -### Features - -* **cloudfront:** extend device type detection ([beb89ea](https://github.com/nuxt-community/device-module/commit/beb89eae5bb05d8e5a5417e1307b0c07f93a0a00)) - -## [3.0.0](https://github.com/nuxt-community/device-module/compare/v2.1.0...v3.0.0) (2022-11-12) - -### Features - - * Nuxt3 support (#119) - -## [2.1.0](https://github.com/nuxt-community/device-module/compare/v2.0.1...v2.1.0) (2021-04-12) - - -### Features - -* Add browser detection. ([7565909](https://github.com/nuxt-community/device-module/commit/75659099455084c63fb5e4320b3bf699613129ae)) -* Add isCrawler flag. ([37882bd](https://github.com/nuxt-community/device-module/commit/37882bdb6fe023aae839b06e7500066186f5b143)) -* add refreshOnResize option ([3d2e0d1](https://github.com/nuxt-community/device-module/commit/3d2e0d10acdb3c307b43be770765ca9e07d43ca6)) - - -### Bug Fixes - -* fix incorrect regex for edge browser ([79e4ffd](https://github.com/nuxt-community/device-module/commit/79e4ffd85c079102ae1085fbe16267c0797d4169)) -* make the regex that detect a crawler case sensitive. ([8032d85](https://github.com/nuxt-community/device-module/commit/8032d85209796c7f7c34eceef8d236ed7327eed0)) - -### [2.0.1](https://github.com/nuxt-community/device-module/compare/v2.0.0...v2.0.1) (2021-02-27) - -### Features - -* added support for the in-app browsers of Instagram and Facebook (#59) - -## [2.0.0](https://github.com/nuxt-community/device-module/compare/v1.2.7...v2.0.0) (2021-01-27) - - -### ⚠ BREAKING CHANGES - -* improvements of the module (#56) - -### Features - -* improvements of the module ([#56](https://github.com/nuxt-community/device-module/issues/56)) ([a822554](https://github.com/nuxt-community/device-module/commit/a82255457b4aa292c80e1a1751151a5b8eea4fc9)) - -### [1.2.7](https://github.com/nuxt-community/device-module/compare/v1.2.6...v1.2.7) (2020-02-14) - - -### Bug Fixes - -* **typings:** clean up typings ([61aa3ec](https://github.com/nuxt-community/device-module/commit/61aa3ec030a3bfcc061b81dbd393d2c59a5a7558)) - -### [1.2.6](https://github.com/nuxt-community/device-module/compare/v1.2.5...v1.2.6) (2020-01-31) - -### Bug Fixes - - * migrate a type declaration file to nuxt 2.9+ - -### [1.2.5](https://github.com/nuxt-community/device-module/compare/v1.2.4...v1.2.5) (2020-01-30) - -### Features - - * Add isAndroid property. - -### [1.2.4](https://github.com/nuxt-community/device-module/compare/v1.2.3...v1.2.4) (2019-11-26) - -### Features - - * Add cloudflare detection. - - -### [1.2.3](https://github.com/nuxt-community/device-module/compare/v1.2.2...v1.2.3) (2019-08-24) - -### Bug Fixes - -* add type declaration file. ([c971b60](https://github.com/nuxt-community/device-module/commit/c971b60)) - -### [1.2.2](https://github.com/nuxt-community/device-module/compare/v1.2.1...v1.2.2) (2019-08-14) - -### [1.2.1](https://github.com/nuxt-community/device-module/compare/v1.1.5...v1.2.1) (2019-08-14) diff --git a/package.json b/package.json index 16308e6f..12f8711c 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "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", @@ -41,7 +41,6 @@ "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" @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 616ce396..43ad640b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -188,9 +188,6 @@ importers: '@vue/test-utils': specifier: ^2.5.1 version: 2.5.1(@vue/compiler-dom@3.5.43)(@vue/server-renderer@3.5.43)(vue@3.5.43(typescript@6.0.3)) - changelogen: - specifier: ^0.6.2 - version: 0.6.2(magicast@0.5.5) crawler-user-agents: specifier: ^1.62.0 version: 1.62.0