Skip to content

Commit f2a2770

Browse files
committed
don't use latest for maint branches
1 parent fee2bc2 commit f2a2770

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ jobs:
7373
echo "tag=maint" >> "$GITHUB_OUTPUT"
7474
elif [[ "$BRANCH" =~ ^v[0-9]+$ ]]; then
7575
echo "tag=$BRANCH" >> "$GITHUB_OUTPUT"
76+
else
77+
echo "latest=true" >> "$GITHUB_OUTPUT"
7678
fi
7779
- name: Publish Packages
7880
if: steps.commit.outputs.committed == 'true'
7981
run: pnpm run changeset:publish ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }}
8082
- name: Create GitHub Release
8183
if: steps.commit.outputs.committed == 'true'
82-
run: node scripts/create-github-release.mjs ${{ steps.dist-tag.outputs.prerelease == 'true' && '--prerelease' }}
84+
run: node scripts/create-github-release.mjs ${{ steps.dist-tag.outputs.prerelease == 'true' && '--prerelease' }} ${{ steps.dist-tag.outputs.latest == 'true' && '--latest' }}
8385
env:
8486
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8587
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/create-github-release.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ const tagName = `release-${date}-${time}`
211211
const titleDate = `${date} ${now.toISOString().slice(11, 16)}`
212212

213213
const isPrerelease = process.argv.includes('--prerelease')
214+
const isLatest = process.argv.includes('--latest')
214215

215216
const body = `Release ${titleDate}
216217
@@ -239,7 +240,7 @@ if (!tagExists) {
239240
}
240241

241242
const prereleaseFlag = isPrerelease ? '--prerelease' : ''
242-
const latestFlag = isPrerelease ? '' : ' --latest'
243+
const latestFlag = isLatest ? ' --latest' : ''
243244
const tmpFile = path.join(tmpdir(), `release-notes-${tagName}.md`)
244245
fs.writeFileSync(tmpFile, body)
245246

0 commit comments

Comments
 (0)