Skip to content

Commit 5eb43b0

Browse files
authored
ci: add release tag (#254)
1 parent 4be49b2 commit 5eb43b0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888

8989
- run: pnpm install
9090

91-
- run: pnpm release --vapor --skip-tests
91+
- run: pnpm release --vapor --skip-tests --tag ${{ github.ref == 'refs/heads/main' && 'latest' || 'branch' }}
9292
env:
9393
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9494
NPM_CONFIG_PROVENANCE: 'true'

Diff for: scripts/release.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,21 @@ async function main() {
140140
const major = semver.major(currentVersion)
141141
let newVersion
142142

143+
// The canary version string format is `3.yyyyMMdd.0` (or `3.yyyyMMdd.0-minor.0` for minor)
144+
// Use UTC date so that it's consistent across CI and maintainers' machines
145+
const date = new Date()
146+
const yyyy = date.getUTCFullYear()
147+
const MM = (date.getUTCMonth() + 1).toString().padStart(2, '0')
148+
const dd = date.getUTCDate().toString().padStart(2, '0')
149+
const datestamp = `${yyyy}${MM}${dd}`
150+
143151
if (isCanary) {
144-
// The canary version string format is `3.yyyyMMdd.0` (or `3.yyyyMMdd.0-minor.0` for minor)
145-
// Use UTC date so that it's consistent across CI and maintainers' machines
146-
const date = new Date()
147-
const yyyy = date.getUTCFullYear()
148-
const MM = (date.getUTCMonth() + 1).toString().padStart(2, '0')
149-
const dd = date.getUTCDate().toString().padStart(2, '0')
150-
151-
const datestamp = `${yyyy}${MM}${dd}`
152152
newVersion = `${major}.${datestamp}.0`
153153
if (args.tag && args.tag !== 'latest') {
154154
newVersion = `${major}.${datestamp}.0-${args.tag}.0`
155155
}
156156
} else {
157-
newVersion = `${major}.2024.0-${await getSha(true)}`
157+
newVersion = `${major}.${datestamp}.0-${await getSha(true)}`
158158
}
159159

160160
// check the registry to avoid version collision

0 commit comments

Comments
 (0)