From 4e8d10364a51bccdca1830a925b5221eea1296e8 Mon Sep 17 00:00:00 2001 From: mlischetti Date: Thu, 23 Oct 2025 16:33:06 -0300 Subject: [PATCH] W-20004524: Try to fix release action --- .github/workflows/release.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1e7c3f..70e01ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,6 @@ name: Release DataWeave Native CLI -on: - push: - # Sequence of patterns matched against refs/tags - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 +on: workflow_dispatch jobs: @@ -24,14 +20,25 @@ jobs: runs-on: ${{ matrix.os }} # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 + # Check tag + - name: Check Tag + id: check-tag + run: | + echo "Check tag ${{ github.event.ref }}" + if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "match=true" >> $GITHUB_OUTPUT + fi + + # Setup Gradle - name: Setup Gradle + if: steps.check-tag.outputs.match == 'true' uses: gradle/actions/setup-gradle@v3 # Setup Graalvm - name: Setup Graalvm + if: steps.check-tag.outputs.match == 'true' uses: graalvm/setup-graalvm@v1 with: # version: ${{env.GRAALVM_VERSION}} @@ -40,23 +47,27 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Guess Extension Version + if: steps.check-tag.outputs.match == 'true' run: | echo "NATIVE_VERSION=$(echo '${{github.ref}}' | sed -e 's,.*/v\(.*\),\1,')" >> $GITHUB_ENV shell: bash # Runs a single command using the runners shell - name: Run Build + if: steps.check-tag.outputs.match == 'true' run: | ./gradlew --stacktrace --no-problems-report build -PnativeVersion=${{env.NATIVE_VERSION}} shell: bash # Generate distro - name: Create Distro + if: steps.check-tag.outputs.match == 'true' run: ./gradlew --stacktrace --no-problems-report native-cli:distro -PnativeVersion=${{env.NATIVE_VERSION}} shell: bash # Upload the artifact file - name: Upload binaries to release + if: steps.check-tag.outputs.match == 'true' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }}