Skip to content

Commit

Permalink
ci: fix release tagging (#1389)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain authored Nov 2, 2024
1 parent d496565 commit 2b19920
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions projenrc/ReleaseBranches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class StableReleases {

public bind(project: typescript.TypeScriptProject) {
new VersionsFile(project, {
currentBranch: this.currentBranch,
versions: Object.fromEntries(Object.entries(this.branches).map(([version, info]) => [version,
{
minCdk: info.cdkVersion,
Expand Down Expand Up @@ -116,7 +115,7 @@ export class StableReleases {
return {
name: 'Update tags',
run: [
'version=`cat dist/version.txt`',
'version=`cat dist.old/version.txt`',
'echo $version',
].concat(tags.map(tag => `npm dist-tag add ${project.package.packageName}@$version ${tag}`)).join('\n'),
env: {
Expand Down
8 changes: 4 additions & 4 deletions projenrc/VersionsFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Component, TextFile } from 'projen';

export interface VersionsFileOptions {
path?: string;
currentBranch: string;
versions: {
[key: string]: {
minCdk: string;
Expand All @@ -16,11 +15,12 @@ export interface VersionsFileOptions {
export class VersionsFile extends Component {
public constructor(scope: IConstruct, {
path = 'VERSIONS.md',
currentBranch,
versions,
}: VersionsFileOptions) {
super(scope, `versions#${path}`);

const latestVersion = Object.keys(versions).sort().at(-1);

const table = Object.entries(versions).map(([version, info]) => {
const base = `| ${version} | ^${info.minCdk} | >=${info.minNode} |`;

Expand Down Expand Up @@ -55,9 +55,9 @@ ${table}
| Tag | Description | Major version | Will the version change? |
| ----------- | ---------------------------------------------------- | ------------- | ---------------------------- |
| \`latest\` | The latest stable release of the package | \`${currentBranch}\` | Yes, with new major versions |
| \`latest\` | The latest stable release of the package | \`${latestVersion}\` | Yes, with new major versions |
| \`latest-v*\` | The latest stable release of each major version | n/a | No |
| \`cdk-v2\` | The latest stable release compatible with AWS CDK v2 | \`${currentBranch}\` | Yes, with new major versions |
| \`cdk-v2\` | The latest stable release compatible with AWS CDK v2 | \`${latestVersion}\` | Yes, with new major versions |
| \`cdk-v1\` | The latest stable release compatible with AWS CDK v1 | \`v2\` | No |
`.split('\n'),
});
Expand Down

0 comments on commit 2b19920

Please sign in to comment.