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
23 changes: 23 additions & 0 deletions .github/actions/setup-node-yarn/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Setup Project'
description: 'Checkout code, setup Node.js, enable Yarn, and install dependencies'

runs:
using: 'composite'
steps:
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version-file: '.nvmrc'
cache: yarn

- name: Enable corepack
shell: bash
run: corepack enable

- name: Install dependencies
shell: bash
run: yarn install --immutable

- name: Prepare package
shell: bash
run: yarn prepare
32 changes: 32 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Android Example

on:
workflow_call:

jobs:
build-android-example:
name: Build Android Example
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd

- name: Setup Project
uses: ./.github/actions/setup-node-yarn

- name: Setup Java
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Android SDK
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407

- name: Install NDK
run: echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.1.12297006"

- name: Build with Gradle
run: ./gradlew assembleDebug
working-directory: example/android
57 changes: 57 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build iOS Example

on:
workflow_call:

jobs:
build-ios-example:
name: Build iOS Example
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd

- name: Setup Project
uses: ./.github/actions/setup-node-yarn

- name: Setup Xcode
run: sudo xcode-select -s /Applications/Xcode_26.1.app

- name: Setup Ruby
uses: ruby/setup-ruby@d697be2f83c6234b20877c3b5eac7a7f342f0d0c
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: example/ios

- name: Cache CocoaPods
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: |
example/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Install CocoaPods
working-directory: example/ios
run: |
bundle install
bundle exec pod install

- name: Build iOS example for simulator
working-directory: example/ios
run: |
xcodebuild \
-workspace MendixNativeExample.xcworkspace \
-scheme MendixNativeExample \
-configuration Debug \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=latest' \
-derivedDataPath build \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
build
40 changes: 13 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,16 @@ on:
pull_request:

jobs:
lint-and-build:
name: Lint, Type Check & Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd

- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version-file: '.nvmrc'

- name: Enable corepack
run: corepack enable

- name: Install dependencies
run: yarn install --immutable

- name: Type check
run: yarn typecheck

- name: Lint check
run: yarn lint

- name: Build
run: yarn prepare
lint:
name: Lint
uses: ./.github/workflows/lint.yml

build-android:
name: Build Android
needs: lint
uses: ./.github/workflows/build-android.yml

build-ios:
name: Build iOS
needs: lint
uses: ./.github/workflows/build-ios.yml
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint

on:
workflow_call:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd

- name: Setup Project
uses: ./.github/actions/setup-node-yarn

- name: Type check
run: yarn typecheck

- name: Lint check
run: yarn lint
34 changes: 21 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,21 @@ jobs:
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version-file: '.nvmrc'
- name: Setup Project
uses: ./.github/actions/setup-node-yarn

- name: Enable corepack
run: corepack enable
- name: Extract release notes from Unreleased section
id: changelog
run: |
NOTES=$(awk '/## \[Unreleased\]/ {flag=1; next} /^## \[/ {flag=0} flag && NF {print}' CHANGELOG.md)
if [ -z "$NOTES" ] || [ -z "$(echo "$NOTES" | tr -d '[:space:]')" ]; then
echo "Error: No release notes found in the [Unreleased] section of CHANGELOG.md"
echo "Please add release notes before creating a release."
exit 1
fi
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Bump version and update CHANGELOG
id: bump
Expand All @@ -41,18 +49,18 @@ jobs:
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
sed -i "s/## \[Unreleased\]/## [Unreleased]\n\n## [$NEW_VERSION] - $(date +%Y-%m-%d)/" CHANGELOG.md

- name: Extract release notes
id: changelog
- name: Check if release already exists
run: |
NOTES=$(awk '/## \[Unreleased\]/ {flag=1; next} /^## \[/ {flag=0} flag {print}' CHANGELOG.md)
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
if git ls-remote --tags origin | grep -q "refs/tags/${{ steps.bump.outputs.version }}$"; then
echo "Error: Release tag ${{ steps.bump.outputs.version }} already exists"
echo "Please check existing releases or use a different version bump type."
exit 1
fi

- name: Build and pack
id: pack
run: |
yarn install
yarn install --immutable
yarn prepare
yarn pack --filename mendix-native-${{ steps.bump.outputs.version }}.tgz
echo "tgz=mendix-native-${{ steps.bump.outputs.version }}.tgz" >> $GITHUB_OUTPUT
Expand Down