Skip to content
Merged
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
23 changes: 17 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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}}
Expand All @@ -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 }}
Expand Down
Loading