Skip to content

Commit 9af5691

Browse files
authored
CI: Update tag name to match the repo (#84)
#### Problem The tag names from SPL contained nearly the full name of the package, which made sense because there were many packages. The program-specific repos, however, take a different format, and only keep the basename of the directory. Also, they use `@` to separate the name from the version. #### Summary of changes Use the basename and separate with `@`!
1 parent 740e47d commit 9af5691

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/rust/publish.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ cd(path.join(workingDirectory, folder));
1616
const packageToml = getCargo(folder).package;
1717
const oldVersion = packageToml.version;
1818
const packageName = packageToml.name;
19-
const tagName = packageName.replace('spl-', '');
19+
const tagName = path.basename(folder);
2020

2121
// Publish the new version, commit the repo change, tag it, and push it all.
2222
const releaseArgs = dryRun
2323
? []
24-
: ['--tag-name', `${tagName}-v{{version}}`, '--no-confirm', '--execute'];
24+
: ['--tag-name', `${tagName}@v{{version}}`, '--no-confirm', '--execute'];
2525
await $`cargo release ${level} ${releaseArgs}`;
2626

2727
// Stop here if this is a dry run.
@@ -31,9 +31,9 @@ if (dryRun) {
3131

3232
// Get the new version.
3333
const newVersion = getCargo(folder).package.version;
34-
const newGitTag = `${tagName}-v${newVersion}`;
35-
const oldGitTag = `${tagName}-v${oldVersion}`;
36-
const releaseTitle = `SPL ${tagName} - v${newVersion}`;
34+
const newGitTag = `${tagName}@v${newVersion}`;
35+
const oldGitTag = `${tagName}@v${oldVersion}`;
36+
const releaseTitle = `${packageName} - v${newVersion}`;
3737

3838
// Expose the new version to CI if needed.
3939
if (process.env.CI) {

0 commit comments

Comments
 (0)