Skip to content

Commit

Permalink
run less builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain committed Apr 28, 2024
1 parent 1cf928b commit 28d3f16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml

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

16 changes: 14 additions & 2 deletions projenrc/rosetta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export class RosettaPeerDependency extends Component {
super(project);

const constraint = this.calculateVersionConstraint(options.supportedVersions);
const minVersions = this.calculateMinimalVersions(options.supportedVersions);
const latestVersion = this.calculateLatestVersion(options.supportedVersions);

project.addDevDeps(constraint);
project.addPeerDeps(constraint);

Expand All @@ -38,9 +41,13 @@ export class RosettaPeerDependency extends Component {
strategy: {
matrix: {
domain: {
rosetta: this.calculateMinimalVersions(options.supportedVersions),
os: ['ubuntu-latest', 'windows-latest'],
rosetta: minVersions,
os: ['ubuntu-latest'],
},
include: [{
rosetta: latestVersion,
os: 'windows-latest',
}],
},
},
steps: [{
Expand Down Expand Up @@ -96,4 +103,9 @@ export class RosettaPeerDependency extends Component {

return discoveredVersions;
}

private calculateLatestVersion(versions: RosettaPeerDependencyOptions['supportedVersions']): string {
const discoveredVersions = this.calculateMinimalVersions(versions);
return discoveredVersions.sort().pop() ?? 'latest';
}
}

0 comments on commit 28d3f16

Please sign in to comment.