From 11a8c6eeb8c4a2fc5389f58f9f56fec7a0e1e06d Mon Sep 17 00:00:00 2001 From: Yogendra Shelke <25844542+YogendraShelke@users.noreply.github.com> Date: Wed, 10 Dec 2025 12:02:08 +0530 Subject: [PATCH 1/5] chore: enhance GitHub Actions with caching and release notes validation --- .github/workflows/ci.yml | 1 + .github/workflows/release.yml | 28 +++++++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c2d2bf..f28950f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: node-version-file: '.nvmrc' + cache: yarn - name: Enable corepack run: corepack enable diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27a474c..e5df5c0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,10 +30,24 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: node-version-file: '.nvmrc' + cache: 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<> $GITHUB_OUTPUT + echo "$NOTES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: Bump version and update CHANGELOG id: bump run: | @@ -41,18 +55,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<> $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 From 5798a5ad2fff4faf8591f5ea1668292735ea5b4e Mon Sep 17 00:00:00 2001 From: Yogendra Shelke <25844542+YogendraShelke@users.noreply.github.com> Date: Wed, 10 Dec 2025 12:46:58 +0530 Subject: [PATCH 2/5] chore: add GitHub Actions for building Android and iOS examples, and linting --- .github/actions/setup-node-yarn.yml | 26 ++++++++++++++++ .github/workflows/build-android.yml | 29 ++++++++++++++++++ .github/workflows/build-ios.yml | 45 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 39 ++++++++---------------- .github/workflows/lint-and-build.yml | 19 ++++++++++++ .github/workflows/release.yml | 15 ++-------- 6 files changed, 133 insertions(+), 40 deletions(-) create mode 100644 .github/actions/setup-node-yarn.yml create mode 100644 .github/workflows/build-android.yml create mode 100644 .github/workflows/build-ios.yml create mode 100644 .github/workflows/lint-and-build.yml diff --git a/.github/actions/setup-node-yarn.yml b/.github/actions/setup-node-yarn.yml new file mode 100644 index 0000000..198aa46 --- /dev/null +++ b/.github/actions/setup-node-yarn.yml @@ -0,0 +1,26 @@ +name: 'Setup Project' +description: 'Checkout code, setup Node.js, enable Yarn, and install dependencies' + +runs: + using: 'composite' + steps: + - name: Checkout + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd + + - 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 diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml new file mode 100644 index 0000000..8a457ed --- /dev/null +++ b/.github/workflows/build-android.yml @@ -0,0 +1,29 @@ +name: Build Android Example + +on: + workflow_call: + +jobs: + build-android-example: + name: Build Android Example + runs-on: ubuntu-latest + + steps: + - 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 \ No newline at end of file diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml new file mode 100644 index 0000000..2c64142 --- /dev/null +++ b/.github/workflows/build-ios.yml @@ -0,0 +1,45 @@ +name: Build iOS Example + +on: + workflow_call: + +jobs: + build-ios-example: + name: Build iOS Example + runs-on: macos-latest + + steps: + - name: Setup Project + uses: ./.github/actions/setup-node-yarn + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd + with: + xcode-version: latest-stable + + - name: Setup Ruby + uses: ruby/setup-ruby@d697be2f83c6234b20877c3b5eac7a7f342f0d0c + with: + ruby-version: '3.2' + bundler-cache: true + working-directory: example/ios + + - 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f28950f..644d1ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,30 +5,15 @@ on: 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' - cache: yarn - - - 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 + name: Lint and Build + uses: ./.github/workflows/lint-and-build.yml + + build-android: + name: Build Android + needs: lint-and-build + uses: ./.github/workflows/build-android.yml + + build-ios: + name: Build iOS + needs: lint-and-build + uses: ./.github/workflows/build-ios.yml diff --git a/.github/workflows/lint-and-build.yml b/.github/workflows/lint-and-build.yml new file mode 100644 index 0000000..602224e --- /dev/null +++ b/.github/workflows/lint-and-build.yml @@ -0,0 +1,19 @@ +name: Lint and Build + +on: + workflow_call: + +jobs: + lint-and-build: + name: Lint, Type Check & Build + runs-on: ubuntu-latest + + steps: + - name: Setup Project + uses: ./.github/actions/setup-node-yarn + + - name: Type check + run: yarn typecheck + + - name: Lint check + run: yarn lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5df5c0..258ab28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,19 +21,8 @@ jobs: pull-requests: write steps: - - name: Checkout - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd - with: - fetch-depth: 0 - - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 - with: - node-version-file: '.nvmrc' - cache: yarn - - - name: Enable corepack - run: corepack enable + - name: Setup Project + uses: ./.github/actions/setup-node-yarn - name: Extract release notes from Unreleased section id: changelog From b38f864ee8cd50fdf0512698645db345de0c75db Mon Sep 17 00:00:00 2001 From: Yogendra Shelke <25844542+YogendraShelke@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:23:08 +0530 Subject: [PATCH 3/5] chore: add setup-node-yarn action and update workflows to use it --- .../action.yml} | 3 --- .github/workflows/build-android.yml | 3 +++ .github/workflows/build-ios.yml | 14 ++++++++++++++ .github/workflows/lint-and-build.yml | 3 +++ .github/workflows/release.yml | 5 +++++ 5 files changed, 25 insertions(+), 3 deletions(-) rename .github/actions/{setup-node-yarn.yml => setup-node-yarn/action.yml} (85%) diff --git a/.github/actions/setup-node-yarn.yml b/.github/actions/setup-node-yarn/action.yml similarity index 85% rename from .github/actions/setup-node-yarn.yml rename to .github/actions/setup-node-yarn/action.yml index 198aa46..6e550cc 100644 --- a/.github/actions/setup-node-yarn.yml +++ b/.github/actions/setup-node-yarn/action.yml @@ -4,9 +4,6 @@ description: 'Checkout code, setup Node.js, enable Yarn, and install dependencie runs: using: 'composite' steps: - - name: Checkout - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd - - name: Setup Node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 8a457ed..4dd7727 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -9,6 +9,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd + - name: Setup Project uses: ./.github/actions/setup-node-yarn diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 2c64142..f5521c9 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -9,6 +9,9 @@ jobs: runs-on: macos-latest steps: + - name: Checkout + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd + - name: Setup Project uses: ./.github/actions/setup-node-yarn @@ -24,6 +27,17 @@ jobs: 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: | diff --git a/.github/workflows/lint-and-build.yml b/.github/workflows/lint-and-build.yml index 602224e..1ad8603 100644 --- a/.github/workflows/lint-and-build.yml +++ b/.github/workflows/lint-and-build.yml @@ -9,6 +9,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd + - name: Setup Project uses: ./.github/actions/setup-node-yarn diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 258ab28..30e91b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,11 @@ jobs: pull-requests: write steps: + - name: Checkout + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd + with: + fetch-depth: 0 + - name: Setup Project uses: ./.github/actions/setup-node-yarn From 9599edaf19b4fd08eae884e7fe0c414317966968 Mon Sep 17 00:00:00 2001 From: Yogendra Shelke <25844542+YogendraShelke@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:44:21 +0530 Subject: [PATCH 4/5] chore: refactor CI workflow to separate linting into its own job --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/{lint-and-build.yml => lint.yml} | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) rename .github/workflows/{lint-and-build.yml => lint.yml} (82%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 644d1ff..065c669 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,16 +4,16 @@ on: pull_request: jobs: - lint-and-build: - name: Lint and Build - uses: ./.github/workflows/lint-and-build.yml + lint: + name: Lint + uses: ./.github/workflows/lint.yml build-android: name: Build Android - needs: lint-and-build + needs: lint uses: ./.github/workflows/build-android.yml build-ios: name: Build iOS - needs: lint-and-build + needs: lint uses: ./.github/workflows/build-ios.yml diff --git a/.github/workflows/lint-and-build.yml b/.github/workflows/lint.yml similarity index 82% rename from .github/workflows/lint-and-build.yml rename to .github/workflows/lint.yml index 1ad8603..74f69ee 100644 --- a/.github/workflows/lint-and-build.yml +++ b/.github/workflows/lint.yml @@ -1,11 +1,11 @@ -name: Lint and Build +name: Lint on: workflow_call: jobs: - lint-and-build: - name: Lint, Type Check & Build + lint: + name: Lint runs-on: ubuntu-latest steps: From 97cc14703b55545d74e69d6cf4267c58dfced446 Mon Sep 17 00:00:00 2001 From: Yogendra Shelke <25844542+YogendraShelke@users.noreply.github.com> Date: Wed, 10 Dec 2025 15:56:07 +0530 Subject: [PATCH 5/5] chore: update Xcode setup in CI workflow to use specific version --- .github/workflows/build-ios.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index f5521c9..52aa156 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -16,9 +16,7 @@ jobs: uses: ./.github/actions/setup-node-yarn - name: Setup Xcode - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd - with: - xcode-version: latest-stable + run: sudo xcode-select -s /Applications/Xcode_26.1.app - name: Setup Ruby uses: ruby/setup-ruby@d697be2f83c6234b20877c3b5eac7a7f342f0d0c