Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use latest node versions (backport #1060) #1063

Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/auto-tag-dev-v5.2.yml

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

8 changes: 4 additions & 4 deletions .github/workflows/auto-tag-dev-v5.3.yml

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

8 changes: 4 additions & 4 deletions .github/workflows/auto-tag-dev.yml

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

8 changes: 4 additions & 4 deletions .github/workflows/auto-tag-releases-v5.2.yml

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

8 changes: 4 additions & 4 deletions .github/workflows/auto-tag-releases-v5.3.yml

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

8 changes: 4 additions & 4 deletions .github/workflows/auto-tag-releases.yml

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

14 changes: 7 additions & 7 deletions .github/workflows/build.yml

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

8 changes: 4 additions & 4 deletions .github/workflows/release.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/upgrade-main.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/upgrade-maintenance-v5.2.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/upgrade-maintenance-v5.3.yml

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

1 change: 1 addition & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const project = new typescript.TypeScriptProject({
buildWorkflow: false, // We have our own build workflow (need matrix test)
release: false, // We have our own release workflow
defaultReleaseBranch: 'main',
workflowNodeVersion: 'lts/*', // upgrade workflows should run on latest lts version

autoApproveUpgrades: true,
autoApproveOptions: {
Expand Down
8 changes: 5 additions & 3 deletions projenrc/build-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export class BuildWorkflow {
});
}

const nodeVersion = project.minNodeVersion?.split('.', 1).at(0) ?? 'lts/*';

wf.addJobs({
'build': {
env: { CI: 'true' },
Expand Down Expand Up @@ -189,7 +191,7 @@ export class BuildWorkflow {
},
{
name: 'Setup Node.js',
uses: 'actions/setup-node@v3',
uses: 'actions/setup-node@v4',
with: {
'node-version': '${{ matrix.node-version }}',
'cache': 'yarn',
Expand Down Expand Up @@ -234,9 +236,9 @@ export class BuildWorkflow {
},
{
name: 'Setup Node.js',
uses: 'actions/setup-node@v3',
uses: 'actions/setup-node@v4',
with: {
'node-version': project.minNodeVersion,
'node-version': nodeVersion,
'cache': 'yarn',
},
},
Expand Down
2 changes: 1 addition & 1 deletion projenrc/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function ACTIONS_SETUP_NODE(
): github.workflows.JobStep {
return {
name: 'Setup Node.js',
uses: 'actions/setup-node@v3',
uses: 'actions/setup-node@v4',
with: {
'cache': cache || undefined,
'node-version': nodeVersion,
Expand Down
11 changes: 7 additions & 4 deletions projenrc/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export class ReleaseWorkflow {

release.on({ push: { tags: ['v*.*.*'] } });

const nodeVersion = project.minNodeVersion?.split('.', 1).at(0) ?? 'lts/*';

const releasePackageName = 'release-package';
const publishTarget = 'publish-target';
const federateToAwsStep: github.workflows.JobStep = {
Expand Down Expand Up @@ -52,7 +54,7 @@ export class ReleaseWorkflow {
runsOn: ['ubuntu-latest'],
steps: [
ACTIONS_CHECKOUT(),
ACTIONS_SETUP_NODE(project.minNodeVersion),
ACTIONS_SETUP_NODE(nodeVersion),
YARN_INSTALL(),
{
name: 'Prepare Release',
Expand Down Expand Up @@ -212,7 +214,7 @@ export class ReleaseWorkflow {
...ACTIONS_SETUP_NODE(),
with: {
'always-auth': true,
'node-version': project.minNodeVersion,
'node-version': nodeVersion,
'registry-url': `https://registry.npmjs.org/`,
},
},
Expand Down Expand Up @@ -337,6 +339,7 @@ interface AutoTagWorkflowProps {

class AutoTagWorkflow {
public constructor(project: typescript.TypeScriptProject, name: string, props: AutoTagWorkflowProps) {
const nodeVersion = project.minNodeVersion?.split('.', 1).at(0) ?? 'lts/*';
const workflow = project.github!.addWorkflow(name);
workflow.runName = props.runName;
workflow.on({
Expand All @@ -362,7 +365,7 @@ class AutoTagWorkflow {
permissions: { contents: github.workflows.JobPermission.READ },
steps: [
ACTIONS_CHECKOUT(props.branch),
ACTIONS_SETUP_NODE(project.minNodeVersion),
ACTIONS_SETUP_NODE(nodeVersion),
YARN_INSTALL(),
{ name: 'Build', run: 'yarn build' },
{ id: 'git', name: 'Identify git SHA', run: 'echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT' },
Expand All @@ -375,7 +378,7 @@ class AutoTagWorkflow {
permissions: {},
steps: [
ACTIONS_CHECKOUT('${{ needs.pre-flight.outputs.sha }}', { token: '${{ secrets.PROJEN_GITHUB_TOKEN }}' }),
ACTIONS_SETUP_NODE(project.minNodeVersion),
ACTIONS_SETUP_NODE(nodeVersion),
YARN_INSTALL(),
{
name: 'Set git identity',
Expand Down
Loading