diff --git a/README.md b/README.md index db19882f0a..ff84b3db14 100644 --- a/README.md +++ b/README.md @@ -181,12 +181,16 @@ vp migrate Use the official [`setup-vp`](https://github.com/voidzero-dev/setup-vp) action to install Vite+ in GitHub Actions: ```yaml -- uses: voidzero-dev/setup-vp@v1 +- uses: voidzero-dev/setup-vp@ with: node-version: '22' cache: true ``` +Set `` to an exact version from the [`setup-vp` releases page](https://github.com/voidzero-dev/setup-vp/releases). You can use a commit SHA instead. Do not use the `v1` tag. The `v1` tag no longer receives updates. + +See [Automatic Version Updates](https://viteplus.dev/guide/ci#automatic-version-updates) to configure Dependabot or Renovate. + #### Manual Installation & Migration If you are manually migrating a project to Vite+, install these dev dependencies first: diff --git a/docs/guide/ci.md b/docs/guide/ci.md index 916e5abd4c..d6f035d709 100644 --- a/docs/guide/ci.md +++ b/docs/guide/ci.md @@ -6,12 +6,43 @@ You can use `voidzero-dev/setup-vp` to use Vite+ in CI environments. [`voidzero-dev/setup-vp`](https://github.com/voidzero-dev/setup-vp) provides integrations for GitHub Actions and GitLab CI/CD. Both install Vite+ and can install project dependencies. The GitHub Action can also set up Node.js and cache package manager data automatically, while the GitLab CI/CD template uses the Node.js runtime and cache configuration provided by the job. +## setup-vp Versioning + +Set `` in each example to an exact version from the [`setup-vp` releases page](https://github.com/voidzero-dev/setup-vp/releases). You can use a commit SHA instead. Do not use the `v1` tag. The `v1` tag no longer receives updates. + +### Automatic Version Updates + +Dependabot and Renovate can update exact versions in GitHub Actions workflows. + +To use [Dependabot version updates](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates), add a `github-actions` entry to `.github/dependabot.yml`: + +```yaml [.github/dependabot.yml] +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly +``` + +Dependabot checks `uses:` entries in `.github/workflows` each week. + +[Renovate's GitHub Actions manager](https://docs.renovatebot.com/modules/manager/github-actions/) detects `uses:` entries by default. You do not need a package rule for `setup-vp`. + +When you use a commit SHA, add the exact release tag in a comment. Renovate uses the comment to find updates: + +```yaml +- uses: voidzero-dev/setup-vp@ # +``` + +These settings apply only to GitHub Actions workflows. For GitLab CI/CD, update both version values together. + ## GitHub Actions The GitHub Action sets up Vite+, the required Node.js version, and the package manager. This means you usually do not need separate `setup-node`, package-manager setup, or manual dependency caching steps in your workflow. ```yaml [.github/workflows/ci.yml] -- uses: voidzero-dev/setup-vp@v1 +- uses: voidzero-dev/setup-vp@ with: node-version: '24' cache: true @@ -29,11 +60,13 @@ With `cache: true`, `setup-vp` handles dependency caching for you automatically. ## GitLab CI/CD -Use the reusable `setup-vp` remote template in your GitLab CI/CD configuration: +Use the reusable `setup-vp` remote template in your GitLab CI/CD configuration. Set the remote URL and `setup-ref` to the same release tag or commit SHA: ```yaml [.gitlab-ci.yml] include: - - remote: 'https://raw.githubusercontent.com/voidzero-dev/setup-vp/v1/gitlab/setup-vp.yml' + - remote: 'https://raw.githubusercontent.com/voidzero-dev/setup-vp//gitlab/setup-vp.yml' + inputs: + setup-ref: '' test: extends: .setup-vp @@ -76,7 +109,7 @@ If you are migrating an existing GitHub Actions workflow, you can often replace #### After: ```yaml [.github/workflows/ci.yml] -- uses: voidzero-dev/setup-vp@v1 +- uses: voidzero-dev/setup-vp@ with: node-version: '24' cache: true diff --git a/docs/guide/github-actions-cache.md b/docs/guide/github-actions-cache.md index 5fbb4edae6..ca2c0a24d1 100644 --- a/docs/guide/github-actions-cache.md +++ b/docs/guide/github-actions-cache.md @@ -63,6 +63,10 @@ vp run lint # should print "cache hit" Restore `node_modules/.vite/task-cache` after `vp install`, because package installation can recreate or modify `node_modules`. +Set `` below to an exact version from the [`setup-vp` releases page](https://github.com/voidzero-dev/setup-vp/releases). You can use a commit SHA instead. + +See [Automatic Version Updates](/guide/ci#automatic-version-updates) to configure Dependabot or Renovate. + ```yaml [.github/workflows/ci.yml] name: CI @@ -80,7 +84,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: voidzero-dev/setup-vp@v1 + - uses: voidzero-dev/setup-vp@ with: node-version: '24' cache: true diff --git a/packages/cli/README.md b/packages/cli/README.md index 56f6bd17f4..b2ebf48641 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -175,12 +175,16 @@ vp migrate Use the official [`setup-vp`](https://github.com/voidzero-dev/setup-vp) action to install Vite+ in GitHub Actions: ```yaml -- uses: voidzero-dev/setup-vp@v1 +- uses: voidzero-dev/setup-vp@ with: node-version: '22' cache: true ``` +Set `` to an exact version from the [`setup-vp` releases page](https://github.com/voidzero-dev/setup-vp/releases). You can use a commit SHA instead. Do not use the `v1` tag. The `v1` tag no longer receives updates. + +See [Automatic Version Updates](https://viteplus.dev/guide/ci#automatic-version-updates) to configure Dependabot or Renovate. + #### Manual Installation & Migration If you are manually migrating a project to Vite+, install these dev dependencies first: