diff --git a/.github/workflows/ci-gradle.yml b/.github/workflows/ci-gradle.yml index ec2afba..f484dda 100644 --- a/.github/workflows/ci-gradle.yml +++ b/.github/workflows/ci-gradle.yml @@ -14,6 +14,10 @@ on: type: boolean default: true required: false + outputs: + npm_version: + description: The npm package version determined during build + value: ${{ jobs.build.outputs.npm_version }} secrets: gradle_enterprise_access_key: description: Value of the Gradle Enterprise access token to use. @@ -42,6 +46,8 @@ jobs: build: runs-on: ubuntu-latest if: github.event_name != 'schedule' || github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc' + outputs: + npm_version: ${{ steps.npm-version.outputs.npm_version }} steps: - uses: actions/checkout@v6 with: @@ -66,6 +72,15 @@ jobs: - name: build run: ./gradlew ${{ env.GRADLE_SWITCHES }} build + - name: extract npm version + id: npm-version + if: always() + run: | + VERSION_FILE="rewrite-javascript/src/main/resources/META-INF/rewrite-javascript-version.txt" + if [ -f "$VERSION_FILE" ]; then + echo "npm_version=$(cat "$VERSION_FILE")" >> "$GITHUB_OUTPUT" + fi + - name: slackNotificationOfFailure if: (failure() || cancelled()) && github.event_name == 'schedule' && (github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc') uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 diff --git a/.github/workflows/publish-gradle.yml b/.github/workflows/publish-gradle.yml index fb64ebb..bd602e8 100644 --- a/.github/workflows/publish-gradle.yml +++ b/.github/workflows/publish-gradle.yml @@ -9,6 +9,10 @@ on: type: string required: false default: 21 + outputs: + npm_version: + description: The npm package version determined during build + value: ${{ jobs.release.outputs.npm_version }} secrets: gradle_enterprise_access_key: description: Value of the Gradle Enterprise access token to use. @@ -42,6 +46,8 @@ jobs: release: runs-on: ubuntu-latest timeout-minutes: 60 + outputs: + npm_version: ${{ steps.npm-version.outputs.npm_version }} steps: - uses: actions/checkout@v6 with: @@ -80,3 +86,12 @@ jobs: final \ publish \ closeAndReleaseSonatypeStagingRepository + + - name: extract npm version + id: npm-version + if: always() + run: | + VERSION_FILE="rewrite-javascript/src/main/resources/META-INF/rewrite-javascript-version.txt" + if [ -f "$VERSION_FILE" ]; then + echo "npm_version=$(cat "$VERSION_FILE")" >> "$GITHUB_OUTPUT" + fi