Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/compiler_prereleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
version_name:
required: true
type: string
tag_version:
required: false
type: string
secrets:
NPM_TOKEN:
required: true
Expand Down Expand Up @@ -55,4 +58,4 @@ jobs:
- name: Publish packages to npm
run: |
cp ./scripts/release/ci-npmrc ~/.npmrc
scripts/release/publish.js --frfr --ci --versionName=${{ inputs.version_name }} --tag ${{ inputs.dist_tag }}
scripts/release/publish.js --frfr --ci --versionName=${{ inputs.version_name }} --tag=${{ inputs.dist_tag }} ${{ inputs.tag_version && format('--tagVersion={0}', inputs.tag_version) || '' }}
4 changes: 4 additions & 0 deletions .github/workflows/compiler_prereleases_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
version_name:
required: true
type: string
tag_version:
required: false
type: string

permissions: {}

Expand All @@ -29,5 +32,6 @@ jobs:
release_channel: ${{ inputs.release_channel }}
dist_tag: ${{ inputs.dist_tag }}
version_name: ${{ inputs.version_name }}
tag_version: ${{ inputs.tag_version }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 13 additions & 1 deletion compiler/scripts/release/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ async function main() {
choices: ['experimental', 'beta', 'rc'],
default: 'experimental',
})
.option('tag-version', {
description:
'Optional tag version to append to tag name, eg `1` becomes 0.0.0-rc.1',
type: 'number',
default: null,
})
.option('version-name', {
description: 'Version name',
type: 'string',
Expand Down Expand Up @@ -133,7 +139,13 @@ async function main() {
files: {exclude: ['.DS_Store']},
});
const truncatedHash = hash.slice(0, 7);
const newVersion = `${argv.versionName}-${argv.tag}-${truncatedHash}-${dateString}`;
let newVersion =
argv.tagVersion == null || argv.tagVersion === ''
? `${argv.versionName}-${argv.tag}`
: `${argv.versionName}-${argv.tag}.${argv.tagVersion}`;
if (argv.tag === 'experimental' || argv.tag === 'beta') {
newVersion = `${newVersion}-${truncatedHash}-${dateString}`;
}

for (const pkgName of pkgNames) {
const pkgDir = path.resolve(__dirname, `../../packages/${pkgName}`);
Expand Down
Loading