-
Notifications
You must be signed in to change notification settings - Fork 38
139 lines (120 loc) · 5.08 KB
/
Copy pathrelease.yml
File metadata and controls
139 lines (120 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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
jobs:
# This workflow contains a single job called "build"
RELEASE_EXTENSION:
strategy:
matrix:
os: [ mulesoft-ubuntu, mulesoft-windows ]
include:
- os: mulesoft-ubuntu
script_name: linux
- os: mulesoft-windows
script_name: windows
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
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
# Setup Graalvm
- name: Setup Graalvm
uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Guess Extension Version
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
run: |
./gradlew --stacktrace --no-problems-report -PskipNodeTests=true build -PnativeVersion=${{env.NATIVE_VERSION}}
shell: bash
# Generate distro
- name: Create Distro
run: ./gradlew --stacktrace --no-problems-report native-cli:distro -PnativeVersion=${{env.NATIVE_VERSION}}
shell: bash
# Install Python build dependencies (setuptools/wheel may be missing on Windows runners)
- name: Install Python build dependencies
run: python3 -m pip install --upgrade setuptools wheel
shell: bash
# Generate native-lib python wheel
- name: Create Native Lib Python Wheel
run: ./gradlew --stacktrace --no-problems-report native-lib:buildPythonWheel -PnativeVersion=${{env.NATIVE_VERSION}}
shell: bash
# Setup Node.js for native-lib Node package
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
# Stage the native lib and build Node package (npm install, node-gyp, tsc, npm pack)
- name: Create Native Lib Node Package
run: ./gradlew --stacktrace --no-problems-report native-lib:buildNodePackage -PnativeVersion=${{env.NATIVE_VERSION}}
shell: bash
# Run Node.js tests
- name: Run Node.js Tests
run: ./gradlew --stacktrace --no-problems-report native-lib:nodeTest -PnativeVersion=${{env.NATIVE_VERSION}}
shell: bash
# Upload the artifact file
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: native-cli/build/distributions/native-cli-${{env.NATIVE_VERSION}}-native-distro-${{ matrix.script_name }}.zip
asset_name: dw-${{env.NATIVE_VERSION}}-${{runner.os}}
tag: ${{ github.ref }}
overwrite: true
# Upload the Python wheel
- name: Upload Python wheel to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: native-lib/python/dist/dataweave_native-0.0.1-py3-none-any.whl
asset_name: dw-python-wheel-${{env.NATIVE_VERSION}}-${{runner.os}}.whl
tag: ${{ github.ref }}
overwrite: true
# Upload the Node.js package
- name: Upload Node package to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: native-lib/node/dataweave-native-0.0.1.tgz
asset_name: dw-node-package-${{env.NATIVE_VERSION}}-${{runner.os}}.tgz
tag: ${{ github.ref }}
overwrite: true
# Upload the native shared library
- name: Upload native shared library to release (Linux)
if: runner.os == 'Linux'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: native-lib/python/src/dataweave/native/dwlib.so
asset_name: dwlib-${{env.NATIVE_VERSION}}-${{runner.os}}.so
tag: ${{ github.ref }}
overwrite: true
- name: Upload native shared library to release (Windows)
if: runner.os == 'Windows'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: native-lib/python/src/dataweave/native/dwlib.dll
asset_name: dwlib-${{env.NATIVE_VERSION}}-${{runner.os}}.dll
tag: ${{ github.ref }}
overwrite: true
# Upload the native library header
- name: Upload native library header to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: native-lib/python/src/dataweave/native/dwlib.h
asset_name: dwlib-${{env.NATIVE_VERSION}}.h
tag: ${{ github.ref }}
overwrite: true