-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom SP version selection instead of url
- Loading branch information
1 parent
2abed06
commit bf2a446
Showing
2 changed files
with
19 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ name: Run Native Pipeline | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
mendix_version_url: | ||
description: "Provide the url of SP to be used in job (Full path to mxbuild.tar.gz)" | ||
mendix_version: | ||
description: "Provide the SP version to be used (e.g., 10.14.0.43709). If empty, latest defined version from Mendix versions.json will be used." | ||
required: false | ||
default: "" | ||
|
||
|
@@ -81,7 +81,7 @@ jobs: | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
echo "scope=--since --include '*-native'" >> $GITHUB_OUTPUT | ||
else | ||
echo "scope=--include '*-native' --all" >> $GITHUB_OUTPUT | ||
echo "scope=--all--include '*-native'" >> $GITHUB_OUTPUT | ||
fi | ||
fi | ||
|
@@ -93,40 +93,33 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
outputs: | ||
mendix_version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }} | ||
mendix_version_url: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION_URL }} | ||
steps: | ||
- name: "Check out code" | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 | ||
- name: "Get Mendix version from JSON" | ||
id: get-mendix-version | ||
if: ${{ github.event.inputs.mendix_version_url == '' }} | ||
uses: notiz-dev/[email protected] | ||
uses: notiz-dev/github-action-json-property@7a701887f4b568b23eb7b78bb0fc49aaeb1b68d3 # v0.2.0 | ||
with: | ||
path: configs/e2e/mendix-versions.json | ||
prop_path: latest | ||
- name: Set Mendix version and URL | ||
- name: Set Mendix version | ||
id: set-mendix-version | ||
run: | | ||
if [[ -n "${{ github.event.inputs.mendix_version_url }}" ]]; then | ||
MENDIX_VERSION=$(basename ${{ github.event.inputs.mendix_version_url }} | sed 's/mxbuild-\(.*\)\.tar\.gz/\1/') | ||
echo "MENDIX_VERSION=${MENDIX_VERSION}" >> $GITHUB_OUTPUT | ||
echo "MENDIX_VERSION_URL=${{ github.event.inputs.mendix_version_url }}" >> $GITHUB_OUTPUT | ||
if [[ -n "${{ github.event.inputs.mendix_version }}" ]]; then | ||
echo "MENDIX_VERSION=${{ github.event.inputs.mendix_version }}" >> $GITHUB_OUTPUT | ||
else | ||
MENDIX_VERSION="${{ steps.get-mendix-version.outputs.prop }}" | ||
echo "MENDIX_VERSION=${MENDIX_VERSION}" >> $GITHUB_OUTPUT | ||
echo "MENDIX_VERSION_URL=https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz" >> $GITHUB_OUTPUT | ||
echo "MENDIX_VERSION=${{ steps.get-mendix-version.outputs.prop }}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: "Debug Mendix Version" | ||
run: | | ||
echo "Mendix Version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }}" | ||
echo "Mendix Version URL: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION_URL }}" | ||
docker-images: | ||
needs: mendix-version | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: "Login to GitHub Container Registry" | ||
uses: docker/[email protected] | ||
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
|
@@ -136,17 +129,16 @@ jobs: | |
docker manifest inspect ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} || EXIT_CODE=$? | ||
echo "IMAGE_MISSING=$EXIT_CODE" >> $GITHUB_ENV | ||
- name: "Check out code" | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 | ||
if: ${{ env.IMAGE_MISSING != 0 }} | ||
- name: "Build mxbuild image" | ||
if: ${{ env.IMAGE_MISSING != 0 }} | ||
uses: docker/[email protected] | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | ||
with: | ||
file: ./.github/scripts/mxbuild.Dockerfile | ||
context: ./.github/scripts | ||
build-args: | | ||
MENDIX_VERSION=${{ needs.mendix-version.outputs.mendix_version }} | ||
MENDIX_VERSION_URL=${{ needs.mendix-version.outputs.mendix_version_url }} | ||
push: true | ||
tags: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} | ||
resources: | ||
|
@@ -157,11 +149,11 @@ jobs: | |
contents: read | ||
steps: | ||
- name: "Check out code" | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: "Set up node" | ||
uses: actions/setup-node@v3 | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: yarn | ||
|
@@ -174,7 +166,7 @@ jobs: | |
env: | ||
NODE_OPTIONS: --max_old_space_size=6144 | ||
- name: "Upload resources artifact" | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | ||
with: | ||
name: resources | ||
path: | | ||
|
@@ -197,11 +189,11 @@ jobs: | |
- name: "Download test project" | ||
run: curl -L -o project.zip https://github.com/mendix/Native-Mobile-Resources/archive/refs/heads/main.zip | ||
- name: "Extract test project" | ||
uses: montudor/action-zip@v1 | ||
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0 | ||
with: | ||
args: unzip -qq project.zip -d . | ||
- name: "Download resources artifact" | ||
uses: actions/download-artifact@v3 | ||
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | ||
with: | ||
name: resources | ||
path: resources | ||
|