Skip to content

Commit

Permalink
Merge pull request #1238 from modelix/nodejs-task-dependencies
Browse files Browse the repository at this point in the history
Fix broken publishing workflow
  • Loading branch information
slisson authored Dec 10, 2024
2 parents 3f79cd4 + 8650386 commit bb8bdac
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Set up JDK
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
# exceeds this limit. Therefore, we combine the individual runs in the SARIF files.
- uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version-file: '.nvmrc'
- name: Combine SARIF files
run: |
npx @microsoft/sarif-multitool merge --merge-runs --output-file merged.sarif $(find . -iname '*.sarif*')
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
steps:
- name: Checkout Project
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Set up JDK
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dry-run-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version-file: '.nvmrc'
- name: Cache Node packages
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version-file: '.nvmrc'
- uses: actions/cache@v4
with:
path: node_modules
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/mps-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Set up JDK
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.3.0'
node-version-file: '.nvmrc'
registry-url: 'https://artifacts.itemis.cloud/repository/npm-open/'
scope: '<@modelix>'
- name: Set up JDK
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version-file: '.nvmrc'
- name: Cache Node packages
uses: actions/cache@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.12.0
4 changes: 4 additions & 0 deletions build-logic/src/main/kotlin/org/modelix/GenerateVersion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ fun Project.registerVersionGenerationTask(packageName: String) {
}
}

tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>().all {
dependsOn(generateVersionVariable)
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
dependsOn(generateVersionVariable)
}
Expand Down
5 changes: 4 additions & 1 deletion model-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import dev.petuska.npm.publish.task.NodeExecTask
import dev.petuska.npm.publish.task.NpmPackTask

plugins {
Expand Down Expand Up @@ -152,4 +153,6 @@ npmPublish {
}
}

tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") }
tasks.withType(NodeExecTask::class) {
dependsOn(":setupNodeEverywhere")
}
1 change: 1 addition & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
enabledManagers: [
"pre-commit",
"gradle-wrapper",
"nvm",
],
}
7 changes: 6 additions & 1 deletion ts-model-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import dev.petuska.npm.publish.task.NodeExecTask
import org.gradle.kotlin.dsl.withType

plugins {
base
alias(libs.plugins.node)
Expand Down Expand Up @@ -80,4 +83,6 @@ npmPublish {
}
}

tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") }
tasks.withType(NodeExecTask::class) {
dependsOn(":setupNodeEverywhere")
}
6 changes: 5 additions & 1 deletion vue-model-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import com.github.gradle.node.npm.task.NpmTask
import dev.petuska.npm.publish.task.NodeExecTask
import dev.petuska.npm.publish.task.NpmPackTask
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import org.gradle.kotlin.dsl.withType

plugins {
base
Expand Down Expand Up @@ -135,4 +137,6 @@ tasks.assemble {
dependsOn("packJsPackage")
}

tasks.named("packJsPackage") { dependsOn(":setupNodeEverywhere") }
tasks.withType(NodeExecTask::class) {
dependsOn(":setupNodeEverywhere")
}

0 comments on commit bb8bdac

Please sign in to comment.