Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 3 additions & 21 deletions .github/actions/cli/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: CLI artifact
description: >-
Produces the DataWeave `dw` CLI distro zip; optionally runs the master-only
native-cli regression/TCK suites; optionally publishes the distro as a CI
artifact (main) or a release asset (release). Requires build-foundation to
have run earlier in the same job.
artifact. Requires build-foundation to have run earlier in the same job.
inputs:
native-version:
description: -PnativeVersion value; empty omits the flag.
Expand All @@ -14,13 +13,9 @@ inputs:
required: false
default: 'false'
publish:
description: "'none' | 'artifact' | 'release'."
description: "'none' | 'artifact'."
required: false
default: 'none'
repo-token:
description: Token for svenstaro release upload (publish=release).
required: false
default: ''
arch:
description: Runtime arch token for artifact/asset names.
required: false
Expand All @@ -33,10 +28,6 @@ inputs:
description: Gradle distro classifier (linux/windows/osx) for the source zip name.
required: false
default: ''
tag:
description: Release tag (publish=release).
required: false
default: ''
runs:
using: composite
steps:
Expand All @@ -58,15 +49,6 @@ runs:
if: inputs.publish == 'artifact'
uses: actions/upload-artifact@v7.0.1
with:
name: cli-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}
path: native-cli/build/distributions/dw-cli-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.zip
archive: false

- name: Upload binaries to release
if: inputs.publish == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-cli/build/distributions/native-cli-${{ inputs.native-version }}-native-distro-${{ inputs.distro-os }}.zip
asset_name: dw-cli-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.zip
tag: ${{ inputs.tag }}
overwrite: true
53 changes: 2 additions & 51 deletions .github/actions/native-lib/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@ name: Native shared library artifact
description: >-
Stages and publishes the raw dwlib shared library (dwlib.so/.dll/.dylib) and
its C header (dwlib.h) — the FFI surface both the Python and Node bindings
embed, published here as standalone downloads. Requires build-foundation
earlier in the same job.
embed — as CI artifacts. Requires build-foundation earlier in the same job.
inputs:
native-version:
description: -PnativeVersion value; empty omits the flag.
required: false
default: ''
publish:
description: "'none' | 'artifact' | 'release'."
description: "'none' | 'artifact'."
required: false
default: 'none'
repo-token:
description: Token for svenstaro release upload (publish=release).
required: false
default: ''
arch:
description: Runtime arch token for artifact/asset names.
required: false
Expand All @@ -25,10 +20,6 @@ inputs:
description: OS naming token (linux/windows/macos) for artifact/asset names.
required: false
default: ''
tag:
description: Release tag (publish=release).
required: false
default: ''
runs:
using: composite
steps:
Expand All @@ -46,43 +37,3 @@ runs:
native-lib/python/src/dataweave/native/dwlib.so
native-lib/python/src/dataweave/native/dwlib.dll
native-lib/python/src/dataweave/native/dwlib.h

- name: Upload native shared library to release (Linux)
if: inputs.publish == 'release' && runner.os == 'Linux'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/src/dataweave/native/dwlib.so
asset_name: dwlib-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.so
tag: ${{ inputs.tag }}
overwrite: true

- name: Upload native shared library to release (Windows)
if: inputs.publish == 'release' && runner.os == 'Windows'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/src/dataweave/native/dwlib.dll
asset_name: dwlib-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.dll
tag: ${{ inputs.tag }}
overwrite: true

- name: Upload native shared library to release (macOS)
if: inputs.publish == 'release' && runner.os == 'macOS'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/src/dataweave/native/dwlib.dylib
asset_name: dwlib-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.dylib
tag: ${{ inputs.tag }}
overwrite: true

- name: Upload native library header to release
if: inputs.publish == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/src/dataweave/native/dwlib.h
asset_name: dwlib-${{ inputs.native-version }}.h
tag: ${{ inputs.tag }}
overwrite: true
37 changes: 5 additions & 32 deletions .github/actions/node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Node artifact
description: >-
Sets up Node.js, builds the DataWeave Node package (which embeds dwlib), and
runs the Node unit/integration tests (always). Optionally runs the master-only
Node TCK conformance lane, and optionally publishes the .tgz as a CI artifact
(main) or a release asset (release). Requires build-foundation earlier in the
same job.
Node TCK conformance lane and optionally publishes the .tgz as a CI artifact.
Requires build-foundation earlier in the same job.
inputs:
native-version:
description: -PnativeVersion value; empty omits the flag.
Expand All @@ -15,13 +14,9 @@ inputs:
required: false
default: 'false'
publish:
description: "'none' | 'artifact' | 'release'."
description: "'none' | 'artifact'."
required: false
default: 'none'
repo-token:
description: Token for svenstaro release upload (publish=release).
required: false
default: ''
arch:
description: Runtime arch token for artifact/asset names.
required: false
Expand All @@ -30,10 +25,6 @@ inputs:
description: OS naming token (linux/windows/macos) for artifact/asset names.
required: false
default: ''
tag:
description: Release tag (publish=release).
required: false
default: ''
runs:
using: composite
steps:
Expand Down Expand Up @@ -80,32 +71,14 @@ runs:
if: inputs.publish == 'artifact'
uses: actions/upload-artifact@v7.0.1
with:
name: node-platform-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}
path: ${{ steps.node-package.outputs.platform }}
archive: false

- name: Upload meta Node package (artifact)
if: inputs.publish == 'artifact' && inputs.script-name == 'linux'
uses: actions/upload-artifact@v7.0.1
with:
name: node-meta-${{ inputs.native-version }}
path: ${{ steps.node-package.outputs.meta }}
archive: false

- name: Upload platform Node package to release
if: inputs.publish == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: ${{ steps.node-package.outputs.platform }}
asset_name: ${{ steps.node-package.outputs.platform_name }}
tag: ${{ inputs.tag }}
overwrite: true

- name: Upload meta Node package to release
if: inputs.publish == 'release' && inputs.script-name == 'linux'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: ${{ steps.node-package.outputs.meta }}
asset_name: ${{ steps.node-package.outputs.meta_name }}
tag: ${{ inputs.tag }}
overwrite: true
27 changes: 5 additions & 22 deletions .github/actions/python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: >-
Installs Python build dependencies and builds the DataWeave Python wheel
(which embeds dwlib), runs the Python unit/integration tests, and optionally
runs the master-only Python TCK conformance lane before publishing the wheel
as a CI artifact (main) or a release asset (release). Requires
build-foundation to have run earlier in the same job.
as a CI artifact. Requires build-foundation to have run earlier in the same
job.
inputs:
native-version:
description: -PnativeVersion value; empty omits the flag.
Expand All @@ -22,21 +22,13 @@ inputs:
required: false
default: 'false'
platform:
description: Platform token for matrix-qualified TCK JUnit artifact names.
description: Platform token for CI artifact names.
required: false
default: ''
publish:
description: "'none' | 'artifact' | 'release'."
description: "'none' | 'artifact'."
required: false
default: 'none'
repo-token:
description: Token for svenstaro release upload (publish=release).
required: false
default: ''
tag:
description: Release tag (publish=release).
required: false
default: ''
runs:
using: composite
steps:
Expand All @@ -60,19 +52,10 @@ runs:
if: inputs.publish == 'artifact'
uses: actions/upload-artifact@v7.0.1
with:
name: python-wheel-${{ inputs.native-version }}-${{ inputs.platform }}
path: native-lib/python/dist/dataweave_native-0.0.1-py3-*.whl
archive: false

- name: Upload Python wheel to release
if: inputs.publish == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/dist/dataweave_native-0.0.1-py3-none-*.whl
file_glob: true
tag: ${{ inputs.tag }}
overwrite: true

- name: Run Python TCK Conformance
if: always() && inputs.run-tck == 'true'
run: ./gradlew --stacktrace --no-problems-report native-lib:pythonTck
Expand Down
73 changes: 61 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ jobs:
uses: ./.github/actions/cli
with:
native-version: ${{ env.NATIVE_VERSION }}
publish: 'release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
publish: 'artifact'
arch: ${{ env.ARCH }}
script-name: ${{ matrix.script_name }}
distro-os: ${{ matrix.distro_os }}
Expand All @@ -62,26 +60,77 @@ jobs:
with:
native-version: ${{ env.NATIVE_VERSION }}
break-system-packages: 'true'
publish: 'release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
platform: ${{ matrix.script_name }}-${{ env.ARCH }}
publish: 'artifact'

- name: Node
uses: ./.github/actions/node
with:
native-version: ${{ env.NATIVE_VERSION }}
publish: 'release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
publish: 'artifact'
arch: ${{ env.ARCH }}
script-name: ${{ matrix.script_name }}

- name: Native library
uses: ./.github/actions/native-lib
with:
native-version: ${{ env.NATIVE_VERSION }}
publish: 'release'
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
publish: 'artifact'
arch: ${{ env.ARCH }}
script-name: ${{ matrix.script_name }}

publish-release:
needs: RELEASE_EXTENSION
runs-on: mulesoft-ubuntu
permissions:
contents: write
steps:
- name: Download release artifacts
uses: actions/download-artifact@v8
with:
path: release-assets
- name: Create release and upload assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
VERSION="${TAG#v}"
HEADER=$(find "release-assets/dwlib-${VERSION}-linux-x86_64" -maxdepth 1 -name 'dwlib.h' -print -quit)
if [ -z "$HEADER" ]; then
echo "dwlib.h is missing"
exit 1
fi
mv "$HEADER" "$RUNNER_TEMP/dwlib.h"
find release-assets -type f -name 'dwlib.h' -delete
mv "$RUNNER_TEMP/dwlib.h" "release-assets/dwlib-${VERSION}.h"
for platform in linux-x86_64 windows-x86_64 macos-arm64; do
case "$platform" in
linux-x86_64) extension=so ;;
windows-x86_64) extension=dll ;;
macos-arm64) extension=dylib ;;
esac
source="release-assets/dwlib-${VERSION}-${platform}/dwlib.${extension}"
if [ ! -f "$source" ]; then
echo "native library is missing: $source"
exit 1
fi
mv "$source" "release-assets/dwlib-${VERSION}-${platform}.${extension}"
done
gh release view "$TAG" || gh release create "$TAG" --generate-notes
shopt -s globstar nullglob
assets=(
release-assets/**/*.zip
release-assets/**/*.whl
release-assets/**/*.tgz
release-assets/dwlib-*.so
release-assets/dwlib-*.dll
release-assets/dwlib-*.dylib
release-assets/dwlib-*.h
)
if [ "${#assets[@]}" -eq 0 ]; then
echo "release artifacts are missing"
exit 1
fi
gh release upload "$TAG" "${assets[@]}" --clobber
Loading
Loading