chore(ci): remove sync-prerelease script (#4486)

This commit is contained in:
Lucas Fernandes Nogueira 2022-06-27 06:36:14 -07:00 committed by GitHub
parent e39e2999e0
commit 66ed165773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 68 deletions

View File

@ -218,14 +218,12 @@
"tauri-runtime": {
"path": "./core/tauri-runtime",
"manager": "rust",
"dependencies": ["tauri-utils"],
"postversion": "node ../../.scripts/covector/sync-prerelease.js ${ pkg.pkg } ${ release.type }"
"dependencies": ["tauri-utils"]
},
"tauri-runtime-wry": {
"path": "./core/tauri-runtime-wry",
"manager": "rust",
"dependencies": ["tauri-utils", "tauri-runtime"],
"postversion": "node ../../.scripts/covector/sync-prerelease.js ${ pkg.pkg } ${ release.type }"
"dependencies": ["tauri-utils", "tauri-runtime"]
},
"tauri-codegen": {
"path": "./core/tauri-codegen",
@ -277,8 +275,7 @@
},
"tauri-driver": {
"path": "./tooling/webdriver",
"manager": "rust",
"postversion": "node ../../.scripts/covector/sync-prerelease.js ${ pkg.pkg } ${ release.type }"
"manager": "rust"
}
}
}

View File

@ -1,62 +0,0 @@
#!/usr/bin/env node
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
/*
This script is solely intended to be run as part of the `covector version` step to
keep the `tauri-runtime`, `tauri-runtime-wry` and `tauri-driver` crates version without the `beta` or `rc` suffix.
*/
const {
readFileSync,
writeFileSync
} = require('fs')
const packageNickname = process.argv[2]
const bump = process.argv[3]
let manifestPath
let dependencyManifestPaths
let changelogPath
if (packageNickname === 'tauri-runtime') {
manifestPath = '../../core/tauri-runtime/Cargo.toml'
dependencyManifestPaths = [
'../../core/tauri/Cargo.toml',
'../../core/tauri-runtime-wry/Cargo.toml'
]
changelogPath = '../../core/tauri-runtime/CHANGELOG.md'
} else if (packageNickname === 'tauri-runtime-wry') {
manifestPath = '../../core/tauri-runtime-wry/Cargo.toml'
dependencyManifestPaths = ['../../core/tauri/Cargo.toml']
changelogPath = '../../core/tauri-runtime-wry/CHANGELOG.md'
} else if (packageNickname === 'tauri-driver') {
manifestPath = '../../tooling/webdriver/Cargo.toml'
dependencyManifestPaths = []
changelogPath = '../../tooling/webdriver/CHANGELOG.md'
} else {
throw new Error(`Unexpected package ${packageNickname}`)
}
let manifest = readFileSync(manifestPath, 'utf-8')
manifest = manifest.replace(
/version = "(\d+\.\d+\.\d+)-[^0-9\.]+\.0"/,
'version = "$1"'
)
writeFileSync(manifestPath, manifest)
let changelog = readFileSync(changelogPath, 'utf-8')
changelog = changelog.replace(/(\d+\.\d+\.\d+)-[^0-9\.]+\.0/, '$1')
writeFileSync(changelogPath, changelog)
for (const dependencyManifestPath of dependencyManifestPaths) {
let dependencyManifest = readFileSync(dependencyManifestPath, 'utf-8')
dependencyManifest = dependencyManifest.replace(
new RegExp(
packageNickname + ' = { version = "(\\d+\\.\\d+.\\d+)-[^0-9.]+.0"'
),
`${packageNickname} = { version = "$1"`
)
writeFileSync(dependencyManifestPath, dependencyManifest)
}