mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
[ci] Create unique preview build versions for canary previews (#93490)
This commit is contained in:
@@ -147,7 +147,7 @@ jobs:
|
||||
- run: pnpm install
|
||||
|
||||
- name: Set preview version
|
||||
if: ${{ contains(fromJSON('["automated-preview","force-preview"]'), needs.deploy-target.outputs.value) }}
|
||||
if: ${{ contains(fromJSON('["automated-preview", "force-preview", "staging"]'), needs.deploy-target.outputs.value) }}
|
||||
run: |
|
||||
node scripts/set-preview-version.js "${{ github.sha }}"
|
||||
pnpm install --no-frozen-lockfile
|
||||
|
||||
@@ -30,6 +30,9 @@ async function main() {
|
||||
// 15.0.0-canary.17 -> 15.0.0
|
||||
// 15.0.0 -> 15.0.0
|
||||
const [semverStableVersion] = lernaConfig.version.split('-')
|
||||
// This can create colliding versions between different forks which should be incredibly rare.
|
||||
// Preview builds are installed by URL anyway which is unique between forks by
|
||||
// controlling the repo var setting the preview builds base url.
|
||||
const version = `${semverStableVersion}-preview-${shortSha}-${dateString}`
|
||||
//
|
||||
// Lerna version requires a non-detached HEAD
|
||||
|
||||
Reference in New Issue
Block a user