Skip to content

Commit 90b503e

Browse files
authored
W-20004524: Try to fix release action (#103)
1 parent dd91845 commit 90b503e

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Release DataWeave Native CLI
2-
on:
3-
push:
4-
# Sequence of patterns matched against refs/tags
5-
tags:
6-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
72

3+
on: workflow_dispatch
84

95
jobs:
106

@@ -24,14 +20,25 @@ jobs:
2420
runs-on: ${{ matrix.os }}
2521
# Steps represent a sequence of tasks that will be executed as part of the job
2622
steps:
27-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2823
- uses: actions/checkout@v4
2924

25+
# Check tag
26+
- name: Check Tag
27+
id: check-tag
28+
run: |
29+
echo "Check tag ${{ github.event.ref }}"
30+
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
31+
echo "match=true" >> $GITHUB_OUTPUT
32+
fi
33+
34+
# Setup Gradle
3035
- name: Setup Gradle
36+
if: steps.check-tag.outputs.match == 'true'
3137
uses: gradle/actions/setup-gradle@v3
3238

3339
# Setup Graalvm
3440
- name: Setup Graalvm
41+
if: steps.check-tag.outputs.match == 'true'
3542
uses: graalvm/setup-graalvm@v1
3643
with:
3744
# version: ${{env.GRAALVM_VERSION}}
@@ -40,23 +47,27 @@ jobs:
4047
github-token: ${{ secrets.GITHUB_TOKEN }}
4148

4249
- name: Guess Extension Version
50+
if: steps.check-tag.outputs.match == 'true'
4351
run: |
4452
echo "NATIVE_VERSION=$(echo '${{github.ref}}' | sed -e 's,.*/v\(.*\),\1,')" >> $GITHUB_ENV
4553
shell: bash
4654

4755
# Runs a single command using the runners shell
4856
- name: Run Build
57+
if: steps.check-tag.outputs.match == 'true'
4958
run: |
5059
./gradlew --stacktrace --no-problems-report build -PnativeVersion=${{env.NATIVE_VERSION}}
5160
shell: bash
5261

5362
# Generate distro
5463
- name: Create Distro
64+
if: steps.check-tag.outputs.match == 'true'
5565
run: ./gradlew --stacktrace --no-problems-report native-cli:distro -PnativeVersion=${{env.NATIVE_VERSION}}
5666
shell: bash
5767

5868
# Upload the artifact file
5969
- name: Upload binaries to release
70+
if: steps.check-tag.outputs.match == 'true'
6071
uses: svenstaro/upload-release-action@v2
6172
with:
6273
repo_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)